emmett API Documentation

This documentation provides a simple and easy way to learn about our API and to integrate it with your application using both our web and REST interfaces. We believe that the web interface is the best way to start, since it will show how our system works in a more natural and friendly way. And when the integration time comes, rest assured that all the funcionalities from the web interface are available through our REST interface.

Of course, we’re assuming that you have a valid license activated in your system; if that’s not the case and you want a free trial, contact us at sales@meerkat.com.br.

Geting Started

There are two straightforward ways to test our API. The first is by using Postman. Just download our collection, import it on Postman and start playing around. You will find examples for our most common features such as adding and playing different types of video streams, detecting and recognizing faces and more.

Authentication

Basically, the API’s authentication is performed through your app key. You must include it on every request headers. You app key is a 64-character string and should be included in a header field called app_key. There are some consideration on this, depending on the system’s deploy. In either case, your key will be shown on the top right of the web interface.

  • On-premise: If you are running the system on premise, once you activate your license a key is automatically generated for you. Also, if you did not create additional keys, i.e. you have a single app key, you do not need to provided in your requests. The system will take this single key as default for all operations.
  • Cloud service: Obtain your trial key in our website following the registration procedure. Then, login in to the web interface and find your APP_KEY displayed on the top right of the webpage. Alternatively, you can request your APP_KEY through the /user/<username> endpoint.

Testing API calls

There are two straightforward ways to test our API. The first is by using [Postman] (https://www.getpostman.com/). Just import our collection on it and start playing around. The second one is by using the code snippets bellow in your favorite programming language.

Support

If you need help, send us an e-mail at support@meerkat.com.br or use the support webapp page

Version

Check API version

Will return the current API version. It should be useful to check the API state also.

GET http://localhost/emmett/version
Requestsexample
Headers
Content-Type: application/json
Responses200
Headers
Content-Type: application/json
Body
{
  "version": "1.0",
  "source_commit": "c71266d"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "description": "API version"
    },
    "source_commit": {
      "type": "string",
      "description": "Hash of the build version"
    }
  },
  "required": [
    "version",
    "source_commit"
  ]
}

Get system current version
GET/version


Activation

Once you get your on-premise version of emmett, you need to activate it online to start using. If you access your webapp and the API is not activated you’ll be redirected to an activation page. Nonetheless, you can activate or check you license status using the REST API, as described below.

Note: all important routes with the exception of /version and /activate will return 404 until your system is activated with your license key. Also, you need internet access to activate the API.

Activate or check your activation

GET http://localhost/emmett/activation
Requestsexample
Headers
Content-Type: application/json
Responses200
Headers
Content-Type: application/json
Body
{
  "is_activated": true,
  "license": {
    "expiration_date": "21/10/2015",
    "key": "12abc345..."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "is_activated": {
      "type": "boolean",
      "description": "Value indicating if your system is activated or not"
    },
    "license": {
      "type": "object",
      "properties": {
        "expiration_date": {
          "type": "string"
        },
        "key": {
          "type": "string"
        }
      },
      "required": [
        "expiration_date",
        "key"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "is_activated",
    "license"
  ]
}

Check license status
GET/activation

Will return if your system is activated or not.


POST http://localhost/emmett/activation
Requestsexample
Headers
Content-Type: application/json
Body
{
  "key": "61683eb9642326ebc458efe5d7414e21"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Your license key"
    }
  }
}
Responses200422
This response has no content.

You key provided as argument is invalid or something went wrong during activation

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Activate your license
POST/activation

This activate your system given your license key. After a minute or two, all the other routes will be available to be used. Please note that the license key is different from the app_key.


App key

This key must be included in the header of every API call. If you are running the system on premise and have a single app key, it can be omitted (a default app key will be used).

GET http://localhost/emmett/app_keys/default
Requestsexample
Headers
Content-Type: application/json
Responses200
Headers
Content-Type: application/json
Body
{
  "app_key": "abcdeabcde"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "app_key": {
      "type": "string",
      "description": "Your app key"
    }
  },
  "required": [
    "app_key"
  ]
}

Retrieve your default app key
GET/app_keys/default

Retrieve the default app_key if the system is running on premise and a single app_key exists.


OCR

The whole purpose of Emmett is read data from images of documents. Here are the routes to do that.

Brazilian documents

There is a single route able to identify which document you’re sending and process the OCR for it. It supports the back and front of Brazilian RG and CNH. You can still use individual routes for each document (as described below), but most of the times a POST to /documents/br/read is the way to go.

POST http://localhost/emmett/documents/br/classify
Requestsexample
Headers
Content-Type: application/json
Body
{
  "imageUrl": "https://link.to.a.rg.file"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageUrl": {
      "type": "string",
      "description": "Url of the photo to process"
    }
  }
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "classification": {
    "document_name": "Brazil - RG - Frente",
    "document_type": "rgfront"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "classification": {
      "type": "object",
      "properties": {
        "document_name": {
          "type": "string",
          "description": "User friendly name for document detected"
        },
        "document_type": {
          "type": "string",
          "description": "Type of document detected"
        }
      }
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Classification using an image URL
POST/documents/br/classify

You can use this route just to detect which type of document appears on the photo. Right now it can return four types: rg_front, rg_back, cnh_front and cnh_back.


POST http://localhost/emmett/documents/br/classify
Requestsexample
Headers
Content-Type: application/json
Body
{
  "imageB64": "/9j/4RiDRXhpZgAATU0AKgA..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageB64": {
      "type": "string",
      "description": "Photo as JPEG base64 encoded string"
    }
  }
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "classification": {
    "document_name": "Brazil - RG - Frente",
    "document_type": "rgfront"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "classification": {
      "type": "object",
      "properties": {
        "document_name": {
          "type": "string",
          "description": "User friendly name for document detected"
        },
        "document_type": {
          "type": "string",
          "description": "Type of document detected"
        }
      }
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Classification using string base64 JPEG
POST/documents/br/classify

You can use this route just to detect which type of document appears on the photo. Right now it can return four types: rg_front, rg_back, cnh_front and cnh_back.


POST http://localhost/emmett/documents/br/read
Requestsexample
Headers
Content-Type: application/json
Body
{
  "imageB64": "/9j/4RiDRXhpZgAATU0AKgA..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageB64": {
      "type": "string",
      "description": "Photo as JPEG base64 encoded string"
    }
  },
  "required": [
    "imageB64"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

One route to rule them all
POST/documents/br/read

This route (/documents/br/read) serves as a proxy for the below ones, by detecting which type of document the photo contains and them calling the corresponding method. You should refer to the below docs of CNH and RG to see what this route’s payload will be.

As other routes that require image as input, you can pass an URL, base64 string or a file using multipart/form-data.


Brazilian RG

Just need to pass the image for this route. It will automatically detect where the document is and if it the front or the back side of it. By front in this document we take as the side in which the person’s photo appears.

POST http://localhost/emmett/documents/br/rg/read
Requestsexampledoc frontdetailed response
Headers
Content-Type: application/json
Body
{
  "imageUrl": "https://link.to.a.rg.file"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageUrl": {
      "type": "string",
      "description": "Url of the photo to process"
    }
  },
  "required": [
    "imageUrl"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "doc_id": {
          "name": "Registro Geral (RG)",
          "value": "123123124",
          "confidence": 96.78
        },
        "name": {
          "name": "Nome do Titular",
          "value": "Frodo Baggins",
          "confidence": 96.78
        },
        "mother_name": {
          "name": "Nome da Mãe",
          "value": "Primula Brandybuck",
          "confidence": 96.78
        },
        "father_name": {
          "name": "Nome do Pai",
          "value": "Drogo Baggings",
          "confidence": 96.78
        },
        "birthplace": {
          "name": "Naturalidade",
          "value": "The Shire",
          "confidence": 96.78
        },
        "issue_date": {
          "name": "Data de Expedicao",
          "value": "02/01/2019",
          "confidence": 96.78
        },
        "birthdate": {
          "name": "Data de Nascimento",
          "value": "20/01/1983",
          "confidence": 96.78
        },
        "cpf": {
          "name": "CPF",
          "value": "0123012301",
          "confidence": 96.78
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - RG - Verso",
      "type": "rg_back",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}
Headers
Content-Type: application/json
Body
{
  "imageUrl": "https://link.to.a.rg.file"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageUrl": {
      "type": "string",
      "description": "Url of the photo to process"
    }
  },
  "required": [
    "imageUrl"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "issuing_authority": {
          "name": "Orgão Emissor",
          "value": "Secretaria de Segurança Pública",
          "confidence": 96.78
        },
        "state": {
          "name": "Estado",
          "value": "Rio Grande do Sul",
          "confidence": 96.78
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - RG - Frente",
      "type": "rg_front",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}
Headers
Content-Type: application/json
Body
{
  "imageUrl": "https://link.to.a.rg.file",
  "detailed": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageUrl": {
      "type": "string",
      "description": "Url of the photo to process"
    },
    "detailed": {
      "type": "boolean",
      "description": "Include additional details such as corners and strings of each field's line"
    }
  },
  "required": [
    "imageUrl"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "doc_id": {
          "name": "Registro Geral (RG)",
          "value": "123123124",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "name": {
          "name": "Nome do Titular",
          "value": "Frodo Baggins",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "mother_name": {
          "name": "Nome da Mãe",
          "value": "Primula Brandybuck",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "father_name": {
          "name": "Nome do Pai",
          "value": "Drogo Baggings",
          "confidence": 96.78
        },
        "birthplace": {
          "name": "Naturalidade",
          "value": "The Shire",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "issue_date": {
          "name": "Data de Expedicao",
          "value": "02/01/2019",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "birthdate": {
          "name": "Data de Nascimento",
          "value": "20/01/1983",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "cpf": {
          "name": "CPF",
          "value": "0123012301",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - RG - Verso",
      "type": "rg_back",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

OCR for RG using image URL
POST/documents/br/rg/read


POST http://localhost/emmett/documents/br/rg/read
Requestsexampledoc frontdetailed response
Headers
Content-Type: application/json
Body
{
  "imageB64": "/9j/4RiDRXhpZgAATU0AKgA..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageB64": {
      "type": "string",
      "description": "Photo as JPEG base64 encoded string"
    }
  },
  "required": [
    "imageB64"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "doc_id": {
          "name": "Registro Geral (RG)",
          "value": "123123124",
          "confidence": 96.78
        },
        "name": {
          "name": "Nome do Titular",
          "value": "Frodo Baggins",
          "confidence": 96.78
        },
        "mother_name": {
          "name": "Nome da Mãe",
          "value": "Primula Brandybuck",
          "confidence": 96.78
        },
        "father_name": {
          "name": "Nome do Pai",
          "value": "Drogo Baggings",
          "confidence": 96.78
        },
        "birthplace": {
          "name": "Naturalidade",
          "value": "The Shire",
          "confidence": 96.78
        },
        "issue_date": {
          "name": "Data de Expedicao",
          "value": "02/01/2019",
          "confidence": 96.78
        },
        "birthdate": {
          "name": "Data de Nascimento",
          "value": "20/01/1983",
          "confidence": 96.78
        },
        "cpf": {
          "name": "CPF",
          "value": "0123012301",
          "confidence": 96.78
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - RG - Verso",
      "type": "rg_back",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}
Headers
Content-Type: application/json
Body
{
  "imageB64": "/9j/4RiDRXhpZgAATU0AKgA..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageB64": {
      "type": "string",
      "description": "Photo as JPEG base64 encoded string"
    }
  },
  "required": [
    "imageB64"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "issuing_authority": {
          "name": "Orgão Emissor",
          "value": "Secretaria de Segurança Pública",
          "confidence": 96.78
        },
        "state": {
          "name": "Estado",
          "value": "Rio Grande do Sul",
          "confidence": 96.78
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - RG - Frente",
      "type": "rg_front",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}
Headers
Content-Type: application/json
Body
{
  "imageB64": "/9j/4RiDRXhpZgAATU0AKgA...",
  "detailed": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageB64": {
      "type": "string",
      "description": "Photo as JPEG base64 encoded string"
    },
    "detailed": {
      "type": "boolean",
      "description": "Include additional details such as corners and strings of each field's line"
    }
  },
  "required": [
    "imageB64"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "doc_id": {
          "name": "Registro Geral (RG)",
          "value": "123123124",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "name": {
          "name": "Nome do Titular",
          "value": "Frodo Baggins",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "mother_name": {
          "name": "Nome da Mãe",
          "value": "Primula Brandybuck",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "father_name": {
          "name": "Nome do Pai",
          "value": "Drogo Baggings",
          "confidence": 96.78
        },
        "birthplace": {
          "name": "Naturalidade",
          "value": "The Shire",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "issue_date": {
          "name": "Data de Expedicao",
          "value": "02/01/2019",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "birthdate": {
          "name": "Data de Nascimento",
          "value": "20/01/1983",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "cpf": {
          "name": "CPF",
          "value": "0123012301",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - RG - Verso",
      "type": "rg_back",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

OCR for RG using string base64 JPEG
POST/documents/br/rg/read


Brazilian CNH

Just need to pass the image for this route. It will automatically detect where the document is and if it the front or the back side of it. By front in this document we take as the side in which most of the person information is.

POST http://localhost/emmett/documents/br/cnh/read
Requestsexampledoc backdetailed response
Headers
Content-Type: application/json
Body
{
  "imageUrl": "https://link.to.a.rg.file"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageUrl": {
      "type": "string",
      "description": "Url of the photo to process"
    }
  },
  "required": [
    "imageUrl"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "register_number": {
          "name": "Numero do Registro",
          "value": "123123124",
          "confidence": 96.78
        },
        "name": {
          "name": "Nome do Titular",
          "value": "Frodo Baggins",
          "confidence": 96.78
        },
        "mother_name": {
          "name": "Nome da Mãe",
          "value": "Primula Brandybuck",
          "confidence": 96.78
        },
        "father_name": {
          "name": "Nome do Pai",
          "value": "Drogo Baggings",
          "confidence": 96.78
        },
        "rg": {
          "name": "Registro Geral",
          "value": "0123012301",
          "confidence": 96.78
        },
        "cpf": {
          "name": "CPF",
          "value": "0123012301",
          "confidence": 96.78
        },
        "birthdate": {
          "name": "Data de Nascimento",
          "value": "02/01/2019",
          "confidence": 96.78
        },
        "habilitation_date": {
          "name": "Data da primeira Habilitacao",
          "value": "20/01/1983",
          "confidence": 96.78
        },
        "expiration_date": {
          "name": "Data de Validade",
          "value": "20/01/1983",
          "confidence": 96.78
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - CNH - Frente",
      "type": "cnh_front",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}
Headers
Content-Type: application/json
Body
{
  "imageUrl": "https://link.to.a.rg.file"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageUrl": {
      "type": "string",
      "description": "Url of the photo to process"
    }
  },
  "required": [
    "imageUrl"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "issue_place": {
          "name": "Local de Emissão",
          "value": "Porto Alegre",
          "confidence": 96.78
        },
        "issue_date": {
          "name": "Data de Emissão",
          "value": "12/03/2011",
          "confidence": 96.78
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - CNH - Verso",
      "type": "cnh_back",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}
Headers
Content-Type: application/json
Body
{
  "imageUrl": "https://link.to.a.rg.file",
  "detailed": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageUrl": {
      "type": "string",
      "description": "Url of the photo to process"
    },
    "detailed": {
      "type": "boolean",
      "description": "Include additional details such as corners and strings of each field's line"
    }
  },
  "required": [
    "imageUrl"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "register_number": {
          "name": "Numero do Registro",
          "value": "123123124",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "name": {
          "name": "Nome do Titular",
          "value": "Frodo Baggins",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "mother_name": {
          "name": "Nome da Mãe",
          "value": "Primula Brandybuck",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "father_name": {
          "name": "Nome do Pai",
          "value": "Drogo Baggings",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "rg": {
          "name": "Registro Geral",
          "value": "0123012301",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "cpf": {
          "name": "CPF",
          "value": "0123012301",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "birthdate": {
          "name": "Data de Nascimento",
          "value": "02/01/2019",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "habilitation_date": {
          "name": "Data da primeira Habilitacao",
          "value": "20/01/1983",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "expiration_date": {
          "name": "Data de Validade",
          "value": "20/01/1983",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - CNH - Frente",
      "type": "cnh_front",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

OCR for CNH using image URL
POST/documents/br/cnh/read


POST http://localhost/emmett/documents/br/cnh/read
Requestsdetailed response
Headers
Content-Type: application/json
Body
{
  "imageB64": "/9j/4RiDRXhpZgAATU0AKgA...",
  "detailed": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageB64": {
      "type": "string",
      "description": "Photo as JPEG base64 encoded string"
    },
    "detailed": {
      "type": "boolean",
      "description": "Include additional details such as corners and strings of each field's line"
    }
  },
  "required": [
    "imageB64"
  ]
}
Responses200401403422
Headers
Content-Type: application/json
Body
{
  "documents": [
    {
      "fields": {
        "register_number": {
          "name": "Numero do Registro",
          "value": "123123124",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "name": {
          "name": "Nome do Titular",
          "value": "Frodo Baggins",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "mother_name": {
          "name": "Nome da Mãe",
          "value": "Primula Brandybuck",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "father_name": {
          "name": "Nome do Pai",
          "value": "Drogo Baggings",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "rg": {
          "name": "Registro Geral",
          "value": "0123012301",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "cpf": {
          "name": "CPF",
          "value": "0123012301",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "birthdate": {
          "name": "Data de Nascimento",
          "value": "02/01/2019",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "habilitation_date": {
          "name": "Data da primeira Habilitacao",
          "value": "20/01/1983",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        },
        "expiration_date": {
          "name": "Data de Validade",
          "value": "20/01/1983",
          "confidence": 96.78,
          "lines": [
            {
              "value": "123abc",
              "confidence": 98.76,
              "corners": [
                {
                  "bottom_right": {
                    "x": 0,
                    "y": 0
                  },
                  "top_left": {
                    "x": 0,
                    "y": 0
                  }
                }
              ]
            }
          ]
        }
      },
      "corners": [
        {
          "x": 0,
          "y": 0
        }
      ],
      "name": "Brasil - CNH - Frente",
      "type": "cnh_front",
      "normalized_image_url": "/images/ac11536fb28c4c70aa7b6d35e4b83a52.jpg"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "documents": {
      "type": "array"
    }
  }
}

No App Key present or unauthorized

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Your license expired

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

Wrong or missing input arguments

Headers
Content-Type: application/json
Body
{
  "error": "Invalid arguments",
  "message": "The input field is invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "error description."
    },
    "message": {
      "type": "string",
      "description": "details on what caused the error."
    }
  },
  "required": [
    "error",
    "message"
  ],
  "additionalProperties": false
}

OCR for CNH using string base64 JPEG
POST/documents/br/cnh/read


Generated by aglio on 30 Jun 2020