Create
Overview
You can create contact by using this API.
Response is just same as the contact list response object.
API detail
Request
- URL:
/contacts/
- Method:
POST
- Content-Type:
application/json
- Body:
{
"email": "test.contact@legale.io",
"company_email": null,
"firstname": "Test",
"lastname1": "Contact",
"lastname2": "",
"rut": "11222333-4",
"phone": null,
"is_user": false,
"is_external": true,
}
Value | Type | Is required | Description |
---|---|---|---|
email | str | Yes | Email of contact, should be unique for user, otherwise, will get an error. |
firstname | str | Yes | First name of contact. |
lastname1 | str | Yes | First last name of contact. |
lastname2 | str | No | Second last name of contact. |
company_email | str | No | Alternative email of contact. |
rut | str | No | RUT of contact, Legale doesn't validate RUT format, if you are going to use this contact for FEA sign method, you should use correct format of RUT, ex: 11222333-4 |
phone | str | No | Phone number of contact. |
is_user | bool | No | If you set this value true , you can see this contact in Legale user list when you are going to send document to legale user. |
is_external | bool | No | If you set this value true , this contact can access to Legale viewer portal, this function will require to use product number - viewer . |
Response
Success
- Status code:
201
- Body:
{
"id": 2620,
"email": "test.contact@legale.io",
"company_email": null,
"firstname": "Test",
"lastname1": "Contact",
"lastname2": null,
"rut": "11222333-4",
"phone": null,
"country_code": null,
"is_user": true,
"is_external": false,
"created_at": "2025-06-27T17:32:52.121284Z",
"updated_at": "2025-06-27T17:32:52.121346Z"
}
Error
- Status code:
400
- Body:
{
"code": "ERROR_CONTACT_DUPLICATED",
"message": "Contact with this email already exists.",
}
Error code | Type | Description |
---|---|---|
ERROR_CONTACT_DUPLICATED | str | You are creating contact with duplicated email. |
ERROR_NO_PRODUCT_NUMBER | str | You are creating contact with parameter is_external = true without enough product number - viewer . |