curl --request POST \
--url https://api.vivara.io/v1/non-payment-insurance/cases/{caseId}/policy \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"landlord": {
"type": "individual",
"firstName": "Carmen",
"lastName": "Ruiz Soler",
"birthDate": "1975-04-12",
"sex": "female",
"email": "carmen.ruiz@example.com",
"phone": "600123456"
},
"correspondenceAddress": {
"streetType": "avenue",
"street": "de América",
"number": 45,
"postalCode": "28028",
"city": "Madrid",
"province": "Madrid"
},
"iban": "ES9121000418450200051332",
"consents": {
"privacyPolicyAccepted": true,
"agreesToBeContacted": false
}
}
'import requests
url = "https://api.vivara.io/v1/non-payment-insurance/cases/{caseId}/policy"
payload = {
"landlord": {
"type": "individual",
"firstName": "Carmen",
"lastName": "Ruiz Soler",
"birthDate": "1975-04-12",
"sex": "female",
"email": "carmen.ruiz@example.com",
"phone": "600123456"
},
"correspondenceAddress": {
"streetType": "avenue",
"street": "de América",
"number": 45,
"postalCode": "28028",
"city": "Madrid",
"province": "Madrid"
},
"iban": "ES9121000418450200051332",
"consents": {
"privacyPolicyAccepted": True,
"agreesToBeContacted": False
}
}
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({
landlord: {
type: 'individual',
firstName: 'Carmen',
lastName: 'Ruiz Soler',
birthDate: '1975-04-12',
sex: 'female',
email: 'carmen.ruiz@example.com',
phone: '600123456'
},
correspondenceAddress: {
streetType: 'avenue',
street: 'de América',
number: 45,
postalCode: '28028',
city: 'Madrid',
province: 'Madrid'
},
iban: 'ES9121000418450200051332',
consents: {privacyPolicyAccepted: true, agreesToBeContacted: false}
})
};
fetch('https://api.vivara.io/v1/non-payment-insurance/cases/{caseId}/policy', 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/{caseId}/policy",
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([
'landlord' => [
'type' => 'individual',
'firstName' => 'Carmen',
'lastName' => 'Ruiz Soler',
'birthDate' => '1975-04-12',
'sex' => 'female',
'email' => 'carmen.ruiz@example.com',
'phone' => '600123456'
],
'correspondenceAddress' => [
'streetType' => 'avenue',
'street' => 'de América',
'number' => 45,
'postalCode' => '28028',
'city' => 'Madrid',
'province' => 'Madrid'
],
'iban' => 'ES9121000418450200051332',
'consents' => [
'privacyPolicyAccepted' => true,
'agreesToBeContacted' => false
]
]),
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/{caseId}/policy"
payload := strings.NewReader("{\n \"landlord\": {\n \"type\": \"individual\",\n \"firstName\": \"Carmen\",\n \"lastName\": \"Ruiz Soler\",\n \"birthDate\": \"1975-04-12\",\n \"sex\": \"female\",\n \"email\": \"carmen.ruiz@example.com\",\n \"phone\": \"600123456\"\n },\n \"correspondenceAddress\": {\n \"streetType\": \"avenue\",\n \"street\": \"de América\",\n \"number\": 45,\n \"postalCode\": \"28028\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"iban\": \"ES9121000418450200051332\",\n \"consents\": {\n \"privacyPolicyAccepted\": true,\n \"agreesToBeContacted\": false\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/{caseId}/policy")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"landlord\": {\n \"type\": \"individual\",\n \"firstName\": \"Carmen\",\n \"lastName\": \"Ruiz Soler\",\n \"birthDate\": \"1975-04-12\",\n \"sex\": \"female\",\n \"email\": \"carmen.ruiz@example.com\",\n \"phone\": \"600123456\"\n },\n \"correspondenceAddress\": {\n \"streetType\": \"avenue\",\n \"street\": \"de América\",\n \"number\": 45,\n \"postalCode\": \"28028\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"iban\": \"ES9121000418450200051332\",\n \"consents\": {\n \"privacyPolicyAccepted\": true,\n \"agreesToBeContacted\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vivara.io/v1/non-payment-insurance/cases/{caseId}/policy")
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 \"landlord\": {\n \"type\": \"individual\",\n \"firstName\": \"Carmen\",\n \"lastName\": \"Ruiz Soler\",\n \"birthDate\": \"1975-04-12\",\n \"sex\": \"female\",\n \"email\": \"carmen.ruiz@example.com\",\n \"phone\": \"600123456\"\n },\n \"correspondenceAddress\": {\n \"streetType\": \"avenue\",\n \"street\": \"de América\",\n \"number\": 45,\n \"postalCode\": \"28028\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"iban\": \"ES9121000418450200051332\",\n \"consents\": {\n \"privacyPolicyAccepted\": true,\n \"agreesToBeContacted\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42",
"status": "pending-documentation",
"effectiveDate": "2026-11-01",
"contractDurationMonths": 12,
"rentalAmountInEuros": 1250,
"tenants": [
{
"id": "6b1e0d44-2c3f-4b8e-a0f2-91d7e5c3a810",
"role": "tenant",
"personalId": "X1234567L",
"externalReference": "TENANT-88412"
}
],
"documentation": {
"complete": false,
"missing": [
{
"anyOf": [
"employment-contract",
"work-history-report"
],
"minFiles": 1,
"uploadedFiles": 0,
"tenantId": "6b1e0d44-2c3f-4b8e-a0f2-91d7e5c3a810",
"templateUrl": "https://files.vivara.es/npi/templates/anexo-lopd.pdf"
}
],
"documents": [
{
"id": "c41a8e93-7d2b-4f6a-b5e1-2a9f0c8d3e17",
"type": "payslip",
"fileName": "nomina-septiembre.pdf",
"uploadedAt": "2026-10-26T10:02:41Z",
"tenantId": "6b1e0d44-2c3f-4b8e-a0f2-91d7e5c3a810"
}
],
"sentToInsurerAt": null
},
"allowedActions": [
"upload-document"
],
"createdAt": "2026-10-26T09:14:03Z",
"updatedAt": "2026-10-26T09:14:05Z",
"externalReference": "CONTRACT-2026-004521",
"statusReason": "Faltan 3 documentos para poder emitir la póliza.",
"offer": {
"code": 16,
"description": "Protección Jurídica Familiar - Impago de alquiler",
"contractable": true,
"coverages": [
{
"code": 101,
"sumInsuredInEuros": 15000
}
],
"exceptions": [
{
"code": "EX-214",
"description": "Ratio renta/ingresos superior al permitido"
}
],
"exclusions": [
{
"code": "EX-214",
"description": "Ratio renta/ingresos superior al permitido"
}
],
"netPremiumInEuros": 423.5,
"totalPremiumInEuros": 451.2,
"firstInstallmentInEuros": 451.2,
"remainingInstallmentsInEuros": 0,
"conditionsPdfUrl": "https://files.vivara.es/npi/3f9c2a7e/offer.pdf"
},
"policy": {
"status": "issued",
"policyNumber": "0471203398",
"requestedAt": "2026-10-26T11:30:00Z",
"issuedAt": "2026-10-26T11:30:04Z",
"documents": [
{
"type": "policy",
"url": "https://files.vivara.es/npi/3f9c2a7e/policy.pdf"
}
]
}
}
}Issue the policy
Requests the policy for a ready-to-issue case (Emisión), with the landlord’s details and the direct-debit account. The insured property is the one sent when quoting.
When the offer is conditioned, Vivara first merges every uploaded document into a single PDF and sends it to the insurer, then requests the issuance. An offer that is not conditioned is issued without sending documents.
If any required document is missing, nothing is sent and the call fails with 422 documentation-incomplete, listing what is missing.
Issuance can complete immediately (policy-issued, with the policy documents) or stay in policy-requested while the insurer finishes it
(for example, reviewing a conditioned offer or waiting for the landlord’s electronic signature). In that case, poll GET /cases/{caseId}.
Safe to retry: if the case is already policy-requested or policy-issued, the case is returned as it is and nothing is sent to the insurer again.
curl --request POST \
--url https://api.vivara.io/v1/non-payment-insurance/cases/{caseId}/policy \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"landlord": {
"type": "individual",
"firstName": "Carmen",
"lastName": "Ruiz Soler",
"birthDate": "1975-04-12",
"sex": "female",
"email": "carmen.ruiz@example.com",
"phone": "600123456"
},
"correspondenceAddress": {
"streetType": "avenue",
"street": "de América",
"number": 45,
"postalCode": "28028",
"city": "Madrid",
"province": "Madrid"
},
"iban": "ES9121000418450200051332",
"consents": {
"privacyPolicyAccepted": true,
"agreesToBeContacted": false
}
}
'import requests
url = "https://api.vivara.io/v1/non-payment-insurance/cases/{caseId}/policy"
payload = {
"landlord": {
"type": "individual",
"firstName": "Carmen",
"lastName": "Ruiz Soler",
"birthDate": "1975-04-12",
"sex": "female",
"email": "carmen.ruiz@example.com",
"phone": "600123456"
},
"correspondenceAddress": {
"streetType": "avenue",
"street": "de América",
"number": 45,
"postalCode": "28028",
"city": "Madrid",
"province": "Madrid"
},
"iban": "ES9121000418450200051332",
"consents": {
"privacyPolicyAccepted": True,
"agreesToBeContacted": False
}
}
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({
landlord: {
type: 'individual',
firstName: 'Carmen',
lastName: 'Ruiz Soler',
birthDate: '1975-04-12',
sex: 'female',
email: 'carmen.ruiz@example.com',
phone: '600123456'
},
correspondenceAddress: {
streetType: 'avenue',
street: 'de América',
number: 45,
postalCode: '28028',
city: 'Madrid',
province: 'Madrid'
},
iban: 'ES9121000418450200051332',
consents: {privacyPolicyAccepted: true, agreesToBeContacted: false}
})
};
fetch('https://api.vivara.io/v1/non-payment-insurance/cases/{caseId}/policy', 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/{caseId}/policy",
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([
'landlord' => [
'type' => 'individual',
'firstName' => 'Carmen',
'lastName' => 'Ruiz Soler',
'birthDate' => '1975-04-12',
'sex' => 'female',
'email' => 'carmen.ruiz@example.com',
'phone' => '600123456'
],
'correspondenceAddress' => [
'streetType' => 'avenue',
'street' => 'de América',
'number' => 45,
'postalCode' => '28028',
'city' => 'Madrid',
'province' => 'Madrid'
],
'iban' => 'ES9121000418450200051332',
'consents' => [
'privacyPolicyAccepted' => true,
'agreesToBeContacted' => false
]
]),
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/{caseId}/policy"
payload := strings.NewReader("{\n \"landlord\": {\n \"type\": \"individual\",\n \"firstName\": \"Carmen\",\n \"lastName\": \"Ruiz Soler\",\n \"birthDate\": \"1975-04-12\",\n \"sex\": \"female\",\n \"email\": \"carmen.ruiz@example.com\",\n \"phone\": \"600123456\"\n },\n \"correspondenceAddress\": {\n \"streetType\": \"avenue\",\n \"street\": \"de América\",\n \"number\": 45,\n \"postalCode\": \"28028\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"iban\": \"ES9121000418450200051332\",\n \"consents\": {\n \"privacyPolicyAccepted\": true,\n \"agreesToBeContacted\": false\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/{caseId}/policy")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"landlord\": {\n \"type\": \"individual\",\n \"firstName\": \"Carmen\",\n \"lastName\": \"Ruiz Soler\",\n \"birthDate\": \"1975-04-12\",\n \"sex\": \"female\",\n \"email\": \"carmen.ruiz@example.com\",\n \"phone\": \"600123456\"\n },\n \"correspondenceAddress\": {\n \"streetType\": \"avenue\",\n \"street\": \"de América\",\n \"number\": 45,\n \"postalCode\": \"28028\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"iban\": \"ES9121000418450200051332\",\n \"consents\": {\n \"privacyPolicyAccepted\": true,\n \"agreesToBeContacted\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vivara.io/v1/non-payment-insurance/cases/{caseId}/policy")
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 \"landlord\": {\n \"type\": \"individual\",\n \"firstName\": \"Carmen\",\n \"lastName\": \"Ruiz Soler\",\n \"birthDate\": \"1975-04-12\",\n \"sex\": \"female\",\n \"email\": \"carmen.ruiz@example.com\",\n \"phone\": \"600123456\"\n },\n \"correspondenceAddress\": {\n \"streetType\": \"avenue\",\n \"street\": \"de América\",\n \"number\": 45,\n \"postalCode\": \"28028\",\n \"city\": \"Madrid\",\n \"province\": \"Madrid\"\n },\n \"iban\": \"ES9121000418450200051332\",\n \"consents\": {\n \"privacyPolicyAccepted\": true,\n \"agreesToBeContacted\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3f9c2a7e-58b1-4d0a-9a51-0c6e2f1b7d42",
"status": "pending-documentation",
"effectiveDate": "2026-11-01",
"contractDurationMonths": 12,
"rentalAmountInEuros": 1250,
"tenants": [
{
"id": "6b1e0d44-2c3f-4b8e-a0f2-91d7e5c3a810",
"role": "tenant",
"personalId": "X1234567L",
"externalReference": "TENANT-88412"
}
],
"documentation": {
"complete": false,
"missing": [
{
"anyOf": [
"employment-contract",
"work-history-report"
],
"minFiles": 1,
"uploadedFiles": 0,
"tenantId": "6b1e0d44-2c3f-4b8e-a0f2-91d7e5c3a810",
"templateUrl": "https://files.vivara.es/npi/templates/anexo-lopd.pdf"
}
],
"documents": [
{
"id": "c41a8e93-7d2b-4f6a-b5e1-2a9f0c8d3e17",
"type": "payslip",
"fileName": "nomina-septiembre.pdf",
"uploadedAt": "2026-10-26T10:02:41Z",
"tenantId": "6b1e0d44-2c3f-4b8e-a0f2-91d7e5c3a810"
}
],
"sentToInsurerAt": null
},
"allowedActions": [
"upload-document"
],
"createdAt": "2026-10-26T09:14:03Z",
"updatedAt": "2026-10-26T09:14:05Z",
"externalReference": "CONTRACT-2026-004521",
"statusReason": "Faltan 3 documentos para poder emitir la póliza.",
"offer": {
"code": 16,
"description": "Protección Jurídica Familiar - Impago de alquiler",
"contractable": true,
"coverages": [
{
"code": 101,
"sumInsuredInEuros": 15000
}
],
"exceptions": [
{
"code": "EX-214",
"description": "Ratio renta/ingresos superior al permitido"
}
],
"exclusions": [
{
"code": "EX-214",
"description": "Ratio renta/ingresos superior al permitido"
}
],
"netPremiumInEuros": 423.5,
"totalPremiumInEuros": 451.2,
"firstInstallmentInEuros": 451.2,
"remainingInstallmentsInEuros": 0,
"conditionsPdfUrl": "https://files.vivara.es/npi/3f9c2a7e/offer.pdf"
},
"policy": {
"status": "issued",
"policyNumber": "0471203398",
"requestedAt": "2026-10-26T11:30:00Z",
"issuedAt": "2026-10-26T11:30:04Z",
"documents": [
{
"type": "policy",
"url": "https://files.vivara.es/npi/3f9c2a7e/policy.pdf"
}
]
}
}
}Path Parameters
Body
The data needed to request the issuance of the policy.