curl --request POST \
--url https://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"all_employees": {
"chronic_disease": []
}
}
'import requests
url = "https://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations"
payload = { "all_employees": { "chronic_disease": [] } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({all_employees: {chronic_disease: []}})
};
fetch('https://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations', 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://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations",
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([
'all_employees' => [
'chronic_disease' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations"
payload := strings.NewReader("{\n \"all_employees\": {\n \"chronic_disease\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"all_employees\": {\n \"chronic_disease\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"all_employees\": {\n \"chronic_disease\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": 123,
"price": 123,
"pending_declarations": [
"<string>"
],
"payment_link": "<string>",
"provider_policy_id": "<string>",
"policy_url": "<string>",
"redirect_url": "<string>",
"meta_data": {
"company_id": 123,
"insurance_provider": "<string>",
"quote_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_price_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"insured": [
{
"name": "<string>",
"nationality_iso": "<string>",
"category": "basic",
"mobile_number": "0500000001",
"date_of_birth": "<string>",
"nationality_id": "1111111111",
"iqama_id": "2222222222",
"dependents": [
{
"name": "<string>",
"relationship": "spouse",
"nationality_iso": "<string>",
"date_of_birth": "<string>",
"nationality_id": "1111111112",
"iqama_id": "2222222222"
}
]
}
]
}
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "40401",
"message": "Not found"
}{
"code": "<string>",
"message": "<string>"
}Fill the declarations
A company admin answers the health declaration on the employees’ behalf. all_employees is the default set of answers; ids_or_emails overrides them for the employees whose history differs. The answers are stored on the members of the policy, and its payment_link appears once nobody is left in pending_declarations.
curl --request POST \
--url https://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"all_employees": {
"chronic_disease": []
}
}
'import requests
url = "https://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations"
payload = { "all_employees": { "chronic_disease": [] } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({all_employees: {chronic_disease: []}})
};
fetch('https://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations', 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://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations",
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([
'all_employees' => [
'chronic_disease' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations"
payload := strings.NewReader("{\n \"all_employees\": {\n \"chronic_disease\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"all_employees\": {\n \"chronic_disease\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.yasmina.ai/api/v1/medical/policies/{policyId}/declarations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"all_employees\": {\n \"chronic_disease\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": 123,
"price": 123,
"pending_declarations": [
"<string>"
],
"payment_link": "<string>",
"provider_policy_id": "<string>",
"policy_url": "<string>",
"redirect_url": "<string>",
"meta_data": {
"company_id": 123,
"insurance_provider": "<string>",
"quote_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_price_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"insured": [
{
"name": "<string>",
"nationality_iso": "<string>",
"category": "basic",
"mobile_number": "0500000001",
"date_of_birth": "<string>",
"nationality_id": "1111111111",
"iqama_id": "2222222222",
"dependents": [
{
"name": "<string>",
"relationship": "spouse",
"nationality_iso": "<string>",
"date_of_birth": "<string>",
"nationality_id": "1111111112",
"iqama_id": "2222222222"
}
]
}
]
}
}{
"code": "40101",
"message": "Unauthenticated"
}{
"code": "40401",
"message": "Not found"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Yes or No for each question, and the list of chronic diseases.
Hide child attributes
Hide child attributes
Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Diabetes, Asthma, Chronic Kidney Disease, Liver Disease, Cancer, None of the above Employees whose answers differ from all_employees, named by nationality_id or iqama_id.
Hide child attributes
Hide child attributes
"1111111111"
Yes or No for each question, and the list of chronic diseases.
Hide child attributes
Hide child attributes
Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Yes, No Diabetes, Asthma, Chronic Kidney Disease, Liver Disease, Cancer, None of the above Response
The policy, with its declarations recorded
0 pending payment, 1 active, 2 cancelled.
The premium for everyone on the policy, for a year.
Employees who still have to declare their medical history. Empty once everyone has.
Where the company pays. A fresh signed link on every read, valid 15 minutes. Null while anyone is in pending_declarations, and once the policy is issued.
The insurer's policy number, once issued.
The policy schedule, once issued.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
The tier this employee picked. Every provider sells all four, so the quote request can price it with each of them.
basic, standard, premium, executive The employee's mobile number.
"0500000001"
Format YYYY-MM-DD. Saudi nationals whose national id starts with 1 give the Hijri (Umm al-Qura) date printed on their id, for example 1409-09-14; everyone else gives a Gregorian date. Employees must be between 18 and 110 years old.
For Saudis. Exactly 10 digits.
^[0-9]{10}$"1111111111"
For non-Saudis. Exactly 10 digits.
^[0-9]{10}$"2222222222"
Family members covered under this employee's policy. They get the same provider and category as the employee. Optional; omit or send an empty array for an employee without dependents.
Hide child attributes
Hide child attributes
How the dependent is related to the employee
spouse, child, parent ISO 3166-1 alpha-2 country code
Format YYYY-MM-DD. Saudi nationals whose national id starts with 1 give the Hijri (Umm al-Qura) date printed on their id, for example 1409-09-14; everyone else gives a Gregorian date. A dependent can be any age up to 110.
Required when nationality_iso is SA. Exactly 10 digits.
^[0-9]{10}$"1111111112"
Required when nationality_iso is not SA. Exactly 10 digits.
^[0-9]{10}$"2222222222"