curl --request POST \
--url https://api.vivara.io/v1/non-payment-insurance/cases \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"id": "3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42",
"externalReference": "CONTRACT-2026-004521",
"effectiveDate": "2026-11-01",
"contractDurationMonths": 12,
"rentalAmountInEuros": 1250,
"insuredProperty": {
"streetType": "street",
"street": "Velázquez",
"number": 12,
"floor": "3",
"door": "B",
"postalCode": "28001",
"city": "Madrid",
"province": "Madrid"
},
"landlord": {
"personalId": "12345678Z"
},
"tenants": [
{
"externalReference": "TENANT-88412",
"role": "tenant",
"personalId": "87654321X",
"birthDate": "1990-05-14",
"postalCode": "28010",
"annualIncomeInEuros": 36000,
"workingStatus": "permanent-employee",
"employmentStartDate": "2021-03-01"
},
{
"externalReference": "TENANT-88413",
"role": "tenant",
"personalId": "X1234567L",
"birthDate": "1992-09-02",
"postalCode": "28010",
"annualIncomeInEuros": 24000,
"workingStatus": "temporary-employee",
"employmentStartDate": "2025-01-15"
}
]
}
'import requests
url = "https://api.vivara.io/v1/non-payment-insurance/cases"
payload = {
"id": "3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42",
"externalReference": "CONTRACT-2026-004521",
"effectiveDate": "2026-11-01",
"contractDurationMonths": 12,
"rentalAmountInEuros": 1250,
"insuredProperty": {
"streetType": "street",
"street": "Velázquez",
"number": 12,
"floor": "3",
"door": "B",
"postalCode": "28001",
"city": "Madrid",
"province": "Madrid"
},
"landlord": { "personalId": "12345678Z" },
"tenants": [
{
"externalReference": "TENANT-88412",
"role": "tenant",
"personalId": "87654321X",
"birthDate": "1990-05-14",
"postalCode": "28010",
"annualIncomeInEuros": 36000,
"workingStatus": "permanent-employee",
"employmentStartDate": "2021-03-01"
},
{
"externalReference": "TENANT-88413",
"role": "tenant",
"personalId": "X1234567L",
"birthDate": "1992-09-02",
"postalCode": "28010",
"annualIncomeInEuros": 24000,
"workingStatus": "temporary-employee",
"employmentStartDate": "2025-01-15"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42',
externalReference: 'CONTRACT-2026-004521',
effectiveDate: '2026-11-01',
contractDurationMonths: 12,
rentalAmountInEuros: 1250,
insuredProperty: {
streetType: 'street',
street: 'Velázquez',
number: 12,
floor: '3',
door: 'B',
postalCode: '28001',
city: 'Madrid',
province: 'Madrid'
},
landlord: {personalId: '12345678Z'},
tenants: [
{
externalReference: 'TENANT-88412',
role: 'tenant',
personalId: '87654321X',
birthDate: '1990-05-14',
postalCode: '28010',
annualIncomeInEuros: 36000,
workingStatus: 'permanent-employee',
employmentStartDate: '2021-03-01'
},
{
externalReference: 'TENANT-88413',
role: 'tenant',
personalId: 'X1234567L',
birthDate: '1992-09-02',
postalCode: '28010',
annualIncomeInEuros: 24000,
workingStatus: 'temporary-employee',
employmentStartDate: '2025-01-15'
}
]
})
};
fetch('https://api.vivara.io/v1/non-payment-insurance/cases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vivara.io/v1/non-payment-insurance/cases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42',
'externalReference' => 'CONTRACT-2026-004521',
'effectiveDate' => '2026-11-01',
'contractDurationMonths' => 12,
'rentalAmountInEuros' => 1250,
'insuredProperty' => [
'streetType' => 'street',
'street' => 'Velázquez',
'number' => 12,
'floor' => '3',
'door' => 'B',
'postalCode' => '28001',
'city' => 'Madrid',
'province' => 'Madrid'
],
'landlord' => [
'personalId' => '12345678Z'
],
'tenants' => [
[
'externalReference' => 'TENANT-88412',
'role' => 'tenant',
'personalId' => '87654321X',
'birthDate' => '1990-05-14',
'postalCode' => '28010',
'annualIncomeInEuros' => 36000,
'workingStatus' => 'permanent-employee',
'employmentStartDate' => '2021-03-01'
],
[
'externalReference' => 'TENANT-88413',
'role' => 'tenant',
'personalId' => 'X1234567L',
'birthDate' => '1992-09-02',
'postalCode' => '28010',
'annualIncomeInEuros' => 24000,
'workingStatus' => 'temporary-employee',
'employmentStartDate' => '2025-01-15'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vivara.io/v1/non-payment-insurance/cases"
payload := strings.NewReader("{\n \"id\": \"3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42\",\n \"externalReference\": \"CONTRACT-2026-004521\",\n \"effectiveDate\": \"2026-11-01\",\n \"contractDurationMonths\": 12,\n \"rentalAmountInEuros\": 1250,\n \"insuredProperty\": {\n \"streetType\": \"street\",\n \"street\": \"Velázquez\",\n \"number\": 12,\n \"floor\": \"3\",\n \"door\": \"B\",\n \"postalCode\": \"28001\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"landlord\": {\n \"personalId\": \"12345678Z\"\n },\n \"tenants\": [\n {\n \"externalReference\": \"TENANT-88412\",\n \"role\": \"tenant\",\n \"personalId\": \"87654321X\",\n \"birthDate\": \"1990-05-14\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 36000,\n \"workingStatus\": \"permanent-employee\",\n \"employmentStartDate\": \"2021-03-01\"\n },\n {\n \"externalReference\": \"TENANT-88413\",\n \"role\": \"tenant\",\n \"personalId\": \"X1234567L\",\n \"birthDate\": \"1992-09-02\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 24000,\n \"workingStatus\": \"temporary-employee\",\n \"employmentStartDate\": \"2025-01-15\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vivara.io/v1/non-payment-insurance/cases")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42\",\n \"externalReference\": \"CONTRACT-2026-004521\",\n \"effectiveDate\": \"2026-11-01\",\n \"contractDurationMonths\": 12,\n \"rentalAmountInEuros\": 1250,\n \"insuredProperty\": {\n \"streetType\": \"street\",\n \"street\": \"Velázquez\",\n \"number\": 12,\n \"floor\": \"3\",\n \"door\": \"B\",\n \"postalCode\": \"28001\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"landlord\": {\n \"personalId\": \"12345678Z\"\n },\n \"tenants\": [\n {\n \"externalReference\": \"TENANT-88412\",\n \"role\": \"tenant\",\n \"personalId\": \"87654321X\",\n \"birthDate\": \"1990-05-14\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 36000,\n \"workingStatus\": \"permanent-employee\",\n \"employmentStartDate\": \"2021-03-01\"\n },\n {\n \"externalReference\": \"TENANT-88413\",\n \"role\": \"tenant\",\n \"personalId\": \"X1234567L\",\n \"birthDate\": \"1992-09-02\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 24000,\n \"workingStatus\": \"temporary-employee\",\n \"employmentStartDate\": \"2025-01-15\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vivara.io/v1/non-payment-insurance/cases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42\",\n \"externalReference\": \"CONTRACT-2026-004521\",\n \"effectiveDate\": \"2026-11-01\",\n \"contractDurationMonths\": 12,\n \"rentalAmountInEuros\": 1250,\n \"insuredProperty\": {\n \"streetType\": \"street\",\n \"street\": \"Velázquez\",\n \"number\": 12,\n \"floor\": \"3\",\n \"door\": \"B\",\n \"postalCode\": \"28001\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"landlord\": {\n \"personalId\": \"12345678Z\"\n },\n \"tenants\": [\n {\n \"externalReference\": \"TENANT-88412\",\n \"role\": \"tenant\",\n \"personalId\": \"87654321X\",\n \"birthDate\": \"1990-05-14\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 36000,\n \"workingStatus\": \"permanent-employee\",\n \"employmentStartDate\": \"2021-03-01\"\n },\n {\n \"externalReference\": \"TENANT-88413\",\n \"role\": \"tenant\",\n \"personalId\": \"X1234567L\",\n \"birthDate\": \"1992-09-02\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 24000,\n \"workingStatus\": \"temporary-employee\",\n \"employmentStartDate\": \"2025-01-15\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyOpen a case
Opens the case with the id you generate (a UUID v4) and prices the standard non-payment insurance offer for the rental contract (Tarificación).
Returns 201 with no body and a Location header. Use GET on that URL to read the offer and the documents the insurer requires. The case is pending-documentation, or rejected when the insurer will not cover the contract (see offer.exclusions).
The required documents depend on each tenant’s workingStatus, plus the data protection annex signed by the landlord and every tenant.
A case id that was already used answers 409 case-already-exists, whatever the data. If a call times out, read GET /non-payment-insurance/cases/{caseId} to know whether the case was opened: 404 means it was not, and you can send the same id again.
curl --request POST \
--url https://api.vivara.io/v1/non-payment-insurance/cases \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"id": "3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42",
"externalReference": "CONTRACT-2026-004521",
"effectiveDate": "2026-11-01",
"contractDurationMonths": 12,
"rentalAmountInEuros": 1250,
"insuredProperty": {
"streetType": "street",
"street": "Velázquez",
"number": 12,
"floor": "3",
"door": "B",
"postalCode": "28001",
"city": "Madrid",
"province": "Madrid"
},
"landlord": {
"personalId": "12345678Z"
},
"tenants": [
{
"externalReference": "TENANT-88412",
"role": "tenant",
"personalId": "87654321X",
"birthDate": "1990-05-14",
"postalCode": "28010",
"annualIncomeInEuros": 36000,
"workingStatus": "permanent-employee",
"employmentStartDate": "2021-03-01"
},
{
"externalReference": "TENANT-88413",
"role": "tenant",
"personalId": "X1234567L",
"birthDate": "1992-09-02",
"postalCode": "28010",
"annualIncomeInEuros": 24000,
"workingStatus": "temporary-employee",
"employmentStartDate": "2025-01-15"
}
]
}
'import requests
url = "https://api.vivara.io/v1/non-payment-insurance/cases"
payload = {
"id": "3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42",
"externalReference": "CONTRACT-2026-004521",
"effectiveDate": "2026-11-01",
"contractDurationMonths": 12,
"rentalAmountInEuros": 1250,
"insuredProperty": {
"streetType": "street",
"street": "Velázquez",
"number": 12,
"floor": "3",
"door": "B",
"postalCode": "28001",
"city": "Madrid",
"province": "Madrid"
},
"landlord": { "personalId": "12345678Z" },
"tenants": [
{
"externalReference": "TENANT-88412",
"role": "tenant",
"personalId": "87654321X",
"birthDate": "1990-05-14",
"postalCode": "28010",
"annualIncomeInEuros": 36000,
"workingStatus": "permanent-employee",
"employmentStartDate": "2021-03-01"
},
{
"externalReference": "TENANT-88413",
"role": "tenant",
"personalId": "X1234567L",
"birthDate": "1992-09-02",
"postalCode": "28010",
"annualIncomeInEuros": 24000,
"workingStatus": "temporary-employee",
"employmentStartDate": "2025-01-15"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42',
externalReference: 'CONTRACT-2026-004521',
effectiveDate: '2026-11-01',
contractDurationMonths: 12,
rentalAmountInEuros: 1250,
insuredProperty: {
streetType: 'street',
street: 'Velázquez',
number: 12,
floor: '3',
door: 'B',
postalCode: '28001',
city: 'Madrid',
province: 'Madrid'
},
landlord: {personalId: '12345678Z'},
tenants: [
{
externalReference: 'TENANT-88412',
role: 'tenant',
personalId: '87654321X',
birthDate: '1990-05-14',
postalCode: '28010',
annualIncomeInEuros: 36000,
workingStatus: 'permanent-employee',
employmentStartDate: '2021-03-01'
},
{
externalReference: 'TENANT-88413',
role: 'tenant',
personalId: 'X1234567L',
birthDate: '1992-09-02',
postalCode: '28010',
annualIncomeInEuros: 24000,
workingStatus: 'temporary-employee',
employmentStartDate: '2025-01-15'
}
]
})
};
fetch('https://api.vivara.io/v1/non-payment-insurance/cases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vivara.io/v1/non-payment-insurance/cases",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42',
'externalReference' => 'CONTRACT-2026-004521',
'effectiveDate' => '2026-11-01',
'contractDurationMonths' => 12,
'rentalAmountInEuros' => 1250,
'insuredProperty' => [
'streetType' => 'street',
'street' => 'Velázquez',
'number' => 12,
'floor' => '3',
'door' => 'B',
'postalCode' => '28001',
'city' => 'Madrid',
'province' => 'Madrid'
],
'landlord' => [
'personalId' => '12345678Z'
],
'tenants' => [
[
'externalReference' => 'TENANT-88412',
'role' => 'tenant',
'personalId' => '87654321X',
'birthDate' => '1990-05-14',
'postalCode' => '28010',
'annualIncomeInEuros' => 36000,
'workingStatus' => 'permanent-employee',
'employmentStartDate' => '2021-03-01'
],
[
'externalReference' => 'TENANT-88413',
'role' => 'tenant',
'personalId' => 'X1234567L',
'birthDate' => '1992-09-02',
'postalCode' => '28010',
'annualIncomeInEuros' => 24000,
'workingStatus' => 'temporary-employee',
'employmentStartDate' => '2025-01-15'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vivara.io/v1/non-payment-insurance/cases"
payload := strings.NewReader("{\n \"id\": \"3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42\",\n \"externalReference\": \"CONTRACT-2026-004521\",\n \"effectiveDate\": \"2026-11-01\",\n \"contractDurationMonths\": 12,\n \"rentalAmountInEuros\": 1250,\n \"insuredProperty\": {\n \"streetType\": \"street\",\n \"street\": \"Velázquez\",\n \"number\": 12,\n \"floor\": \"3\",\n \"door\": \"B\",\n \"postalCode\": \"28001\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"landlord\": {\n \"personalId\": \"12345678Z\"\n },\n \"tenants\": [\n {\n \"externalReference\": \"TENANT-88412\",\n \"role\": \"tenant\",\n \"personalId\": \"87654321X\",\n \"birthDate\": \"1990-05-14\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 36000,\n \"workingStatus\": \"permanent-employee\",\n \"employmentStartDate\": \"2021-03-01\"\n },\n {\n \"externalReference\": \"TENANT-88413\",\n \"role\": \"tenant\",\n \"personalId\": \"X1234567L\",\n \"birthDate\": \"1992-09-02\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 24000,\n \"workingStatus\": \"temporary-employee\",\n \"employmentStartDate\": \"2025-01-15\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vivara.io/v1/non-payment-insurance/cases")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42\",\n \"externalReference\": \"CONTRACT-2026-004521\",\n \"effectiveDate\": \"2026-11-01\",\n \"contractDurationMonths\": 12,\n \"rentalAmountInEuros\": 1250,\n \"insuredProperty\": {\n \"streetType\": \"street\",\n \"street\": \"Velázquez\",\n \"number\": 12,\n \"floor\": \"3\",\n \"door\": \"B\",\n \"postalCode\": \"28001\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"landlord\": {\n \"personalId\": \"12345678Z\"\n },\n \"tenants\": [\n {\n \"externalReference\": \"TENANT-88412\",\n \"role\": \"tenant\",\n \"personalId\": \"87654321X\",\n \"birthDate\": \"1990-05-14\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 36000,\n \"workingStatus\": \"permanent-employee\",\n \"employmentStartDate\": \"2021-03-01\"\n },\n {\n \"externalReference\": \"TENANT-88413\",\n \"role\": \"tenant\",\n \"personalId\": \"X1234567L\",\n \"birthDate\": \"1992-09-02\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 24000,\n \"workingStatus\": \"temporary-employee\",\n \"employmentStartDate\": \"2025-01-15\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vivara.io/v1/non-payment-insurance/cases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42\",\n \"externalReference\": \"CONTRACT-2026-004521\",\n \"effectiveDate\": \"2026-11-01\",\n \"contractDurationMonths\": 12,\n \"rentalAmountInEuros\": 1250,\n \"insuredProperty\": {\n \"streetType\": \"street\",\n \"street\": \"Velázquez\",\n \"number\": 12,\n \"floor\": \"3\",\n \"door\": \"B\",\n \"postalCode\": \"28001\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"landlord\": {\n \"personalId\": \"12345678Z\"\n },\n \"tenants\": [\n {\n \"externalReference\": \"TENANT-88412\",\n \"role\": \"tenant\",\n \"personalId\": \"87654321X\",\n \"birthDate\": \"1990-05-14\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 36000,\n \"workingStatus\": \"permanent-employee\",\n \"employmentStartDate\": \"2021-03-01\"\n },\n {\n \"externalReference\": \"TENANT-88413\",\n \"role\": \"tenant\",\n \"personalId\": \"X1234567L\",\n \"birthDate\": \"1992-09-02\",\n \"postalCode\": \"28010\",\n \"annualIncomeInEuros\": 24000,\n \"workingStatus\": \"temporary-employee\",\n \"employmentStartDate\": \"2025-01-15\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyBody
The data the insurer needs to price the policy: the case id, the contract, the insured property, the landlord and every tenant.
Response
Case opened and priced.