Skip to main content
POST
Create embed session

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme

Body

application/json
otp
string
required

The OTP received by the customer from the Request OTP API

Pattern: ^\d{4}$
Example:

"1234"

owner_id
string
required

The owner's national ID (starts with 1 for Saudi nationals) or Iqama ID (starts with 2 for residents). Must be exactly 10 digits.

Pattern: ^(1|2)\d{9}$
email
string<email>
required

Email address must be valid and belongs to the customer

phone
string
required

Phone number must start with 05 and be 10 digits

Pattern: ^05\d{8}$
birthdate
string<date>
required

Birthdate in YYYY-MM-DD format

car_estimated_cost
number
required

Estimated cost of the car

platform
enum<string>
required

Where the session will run. web for an iframe, webview for a mobile app. There is no default: each one requires a different field below.

Available options:
web,
webview
car_sequence_number
string

Car sequence number must be 8 or 9 digits

Pattern: ^\d{8,9}$
custom_number
string

Customs card number between 100000 and 9999999999 for an imported vehicle. When provided, maker_code, model_code, and body_type_code are required, and car_sequence_number must be omitted.

Pattern: ^[1-9]\d{5,9}$
maker_code
integer

Required with custom_number. Use a code returned by GET /vehicle-makers.

Example:

101

model_code
integer

Required with custom_number. Use a code returned by GET /vehicle-models for the selected maker_code.

Example:

1001

body_type_code
integer

Required with custom_number. Use a code returned by GET /vehicle-body-types.

Example:

3

is_ownership_transfer
boolean
default:false

Indicates if the ownership is being transferred

current_car_owner_id
string

Required if is_ownership_transfer is true; the current owner's national ID (starts with 1) or Iqama ID (starts with 2). Must be exactly 10 digits.

Pattern: ^(1|2)\d{9}$
car_model_year
integer

Car model year between 1950 and next year

Required range: 1950 <= x <= 2026
start_date
string<date>

Desired policy start date in YYYY-MM-DD. Must be between tomorrow and 28 days from today (inclusive). The platform validates this range server-side.

Example:

"2025-12-11"

drivers
object[]

List of drivers for the vehicle. When provided, the sum of all driving_percentage values must equal 100, and the owner must be included among the drivers.

Example:
parent_origin
string

Web only, and required there. The site the iframe will sit on: scheme and domain with nothing after it. Must be one of the iframe hosts registered in API Management. Prohibited for a webview, which has no origin.

Example:

"https://www.example.com"

WebView only, and required there. Where your app is reopened once the policy is issued, with ?yasmina_policy_id= added. Must be one of the deep links registered in API Management. Prohibited for the web, which is handed the policy by postMessage instead.

Example:

"myapp://insurance/done"

locale
enum<string>

The language the embed opens in. Defaults to the customer's browser.

Available options:
ar,
en

Response

The session, with the URL to embed

id
integer

The session id, for reading it back later.

Example:

1

quote_request_id
integer

The quote request the embed was opened on. Yours to keep; you never send it back.

Example:

42

platform
enum<string>

What the session was opened for.

Available options:
web,
webview
embed_url
string

Put this in an iframe or a WebView. Belongs to one customer and expires after an hour.

Example:

"https://.../embed?session=8TJLiR0YhE8ikWSH3N16br2Q4qDg0ozGu18c5c3E"

expires_at
string<date-time>

When the URL stops working.