Submit an end-client application for a unit
const url = 'https://agent-dev.azizdubai.com/units/1/applications';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"client":{"first_name":"Ivan","last_name":"Petrov","email":"ivan.petrov@example.com","mobile_number":"+971 50 111 22 33"},"preferences":{"based_on_unit":true},"message":"Please call me after 6 pm"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://agent-dev.azizdubai.com/units/1/applications \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "client": { "first_name": "Ivan", "last_name": "Petrov", "email": "ivan.petrov@example.com", "mobile_number": "+971 50 111 22 33" }, "preferences": { "based_on_unit": true }, "message": "Please call me after 6 pm" }'Creates four records in the CRM of the company that owns the key: the client, their interests (an opportunity), a draft offer for the selected unit, and the link between the offer and the opportunity. All records are created in a single transaction: either everything is written or nothing is.
Ownership and authorship are taken from the key, as there is no signed-in user behind the request. The key is therefore required: it determines where the application is recorded.
A unit of a draft or deleted project is treated as not found: applications cannot be submitted for units that are not on sale.
The operation is not idempotent: each call creates a new opportunity and a new offer. An existing client is reused if the company already has a client with the same email address or the same mobile number (compared by digits only).
Full details, including the rules for merging interests, are
available in docs/api/applications.md.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Unit ID.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The person submitting the application. A first name and at least one contact channel are required: a lead without contact details cannot be followed up, and the email address and mobile number are also used to match existing clients.
object
Converted to lower case. Must contain @.
Stored as provided, including the country code. Only digits are compared when matching existing clients.
The person submitting the application. A first name and at least one contact channel are required: a lead without contact details cannot be followed up, and the email address and mobile number are also used to match existing clients.
object
Converted to lower case. Must contain @.
Stored as provided, including the country code. Only digits are compared when matching existing clients.
The client’s interests. They can be listed explicitly, derived from
the selected unit with the based_on_unit flag, or both: values that
are sent are kept, and the unit’s data is added to them.
object
“Based on the selected unit”: adds the project’s property type and area, the unit’s tags, the project’s features and amenities, and the unit price as both budget bounds. The budget is the only field that is not merged: an explicitly provided bound takes precedence, and the unit price fills only a missing bound, and only if doing so does not invert the range.
Property types of interest (Project.type values). Stored on the client.
Area IDs from GET /areas. An unknown ID results in 400.
Free-text tags on the client profile. Trimmed; duplicates are removed case-insensitively.
Unit tag IDs from GET /preferences, linked to the opportunity.
Feature/amenity IDs from GET /project-preferences; both sections in a single list.
Free-form integer
The client’s own message. Stored in the opportunity notes; the client’s notes are left unchanged, as that field is reserved for the agent.
Offer language, converted to lower case.
Currency of both the offer and the opportunity budget, so that the figures on the card and in the offer are in the same currency. Defaults to the project currency if it is AED or USD; otherwise AED.
Examples
Minimal request — everything else is derived from the unit
{ "client": { "first_name": "Ivan", "last_name": "Petrov", "email": "ivan.petrov@example.com", "mobile_number": "+971 50 111 22 33" }, "preferences": { "based_on_unit": true }, "message": "Please call me after 6 pm"}Interests specified explicitly and supplemented with unit data
{ "client": { "first_name": "Sara", "mobile_number": "+971 50 998 87 76", "city": "Dubai", "country": "UAE", "social_links": { "instagram": "sara.invests" } }, "preferences": { "based_on_unit": true, "property_types": [ 1, 5 ], "preferred_area_ids": [ 20 ], "property_features": [ "Sea view", "High ROI" ], "preference_ids": [ 7 ], "project_preference_ids": [ 3 ], "investment_type": 2, "min_budget": 1000000, "max_budget": 9000000 }, "currency": "USD", "language": "ar"}Responses
Section titled “Responses”The application has been accepted.
object
The shape depends on the operation.
object
object
false means the application was attached to an existing
client of the company. That client’s fields were not changed,
and the arrays above show what is stored on the record rather
than what this application derived.
The client’s interests — a card on the deals board.
object
Generated as <client> — <project>, unit <number>, up to 255 characters.
object
Column order on the board.
The card is placed at the end of its column.
object
object
object
1 — feature, 2 — amenity.
object
1 — feature, 2 — amenity.
A draft offer. The PDF is generated and sent by the main backend.
object
Public identifier of the offer, used to build the client-facing link.
object
object
In the key’s prices.
1 — ft²
Always false here.
Example
{ "status": "success", "data": { "opportunity": { "stage": { "name": "New Inquiry" }, "project_preferences": { "features": [ { "name": "Infinity Pool", "type": 1 } ], "amenities": [ { "name": "Infinity Pool", "type": 1 } ] } }, "offer": { "measure_units": 1 } }}The request body failed validation: it is not JSON or exceeds 64 KiB, the first name is missing, neither an email address nor a mobile number is provided, a reference ID is unknown, the budget range is inverted, or a value exceeds its maximum length.
object
Human-readable message.
Examples
{ "status": "error", "message": "client.email or client.mobile_number is required"}The key is missing or invalid, or its company or author has been
removed (api key author is gone).
object
Human-readable message.
Example
{ "status": "error"}The key is valid, but it is restricted to a list of domains and the
request’s Origin (or Referer) does not match any of them; or the
key’s agency has no approved licence.
object
Human-readable message.
Examples
{ "status": "error", "message": "origin is not allowed for this api key"}{ "status": "error", "message": "agency license is required: upload a company license and wait for its approval"}No record exists with the given ID — or it belongs to a developer the key’s agency has no approved contract with.
object
Human-readable message.
Examples
{ "status": "error", "message": "unit not found"}An internal server error, or offer status catalogue is empty —
the offer status reference data has not been configured. This
cannot be resolved by the caller.
object
Human-readable message.
Example
{ "status": "error"}