Skip to main content

Create

Overview

You can send document to Legaliza using this API request.

API detail

Request

  • URL: /documents/
  • Method: POST
  • Content-Type: application/json
  • Body:
{
"document_type": 1,
"file": "JVBERi0xLjQNJeLjz9MNCjE1IDAgb2J...",
"file_name": "contract.pdf",
"description": "Contract for notary",
"attached_files": [
{
"type": 1,
"file": "JVBERi0xLjQNJeLjz9MNCjE1IDAgb2J...",
"file_name": "id_card.jpg",
}
],
"signers": [
{
"latitude": 100,
"longitude": 100
},
{
"latitude": 101,
"longitude": 101
}
],
"assign_callback": {
"callback_url": "https://your.callback.com/assign/",
"callback_header": {
"Api-Key": "your service api key"
}
}
}

Request body details

ValueTypeIs requiredDescription
document_typeintYesThe ID of document type of one of document types that you got from here.
filestrYesBase64 string of the PDF file that you are going to upload to Legaliza.
file_namestrYesFile name of the PDF file, file name should be in valid file name format, for example contract.pdf, otherwise, Legaliza will raise validation error.
descriptionstrNoDescription of the PDF file.
  • attached_files
ValueTypeIs requiredDescription
typeintYesThe ID of attached file type of the document type that you selected above.
filestrYesBase64 string of the attached file
file_namestrYesFile name of the attached file, file name should be in valid file name format for PDF, for example contract.pdf, otherwise, Legaliza will raise validation error.
  • signers
ValueTypeIs requiredDescription
latitudefloatYesLatitude of signer geolocation info
longitudefloatYesLongitude of signer geolocation info
  • assign_callback
ValueTypeIs requiredDescription
callback_urlstrYesCallback URL to receive an event when document is assigned to a notary user. You can see more details about the callback request from here.
callback_headerjsonNoExtra API request header that you need to get from callback request, for example, API key for authentication.

Response

Success

  • Status code: 201
  • Body:
{
"id": "bae92562-effb-4db7-a8f8-aabb37674597",
"attached_files": [
{
"id": 1,
"file": "http://dev.api.legaliza.io/media/documents/bae92562-effb-4db7-a8f8-aabb37674597/attached_files/attached1.jpg",
"file_name": "id_card.jpg",
"description": null,
"extra_data": null,
"type": 1
},
],
"file": "http://dev.api.legaliza.io/media/documents/bae92562-effb-4db7-a8f8-aabb37674597/documents/test.pdf",
"file_name": "contract.pdf",
"description": "Contract for notary",
"status": "not_signed",
"customer": "6a579a31-0d99-4ab6-bd4e-eb5436b587a6",
"document_type": 1
}
  • status
ValueTypeDescription
not_signedstrDocument is not signed
signedstrDocument is signed

Error

All the errors are in Spanish, are following general Rest API response error format.

  • Status code: 400
  • Body:
{
"document_type": [
"Este campo es requerido."
]
}