{
  "info": {
    "name": "Sakneen API v1.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Set baseUrl to your assigned HTTPS origin (no trailing slash or API path) and apiKey to your test key in a private Postman environment. Public health does not validate your key. Review each write and use sample data in an approved sandbox. This collection contains contract examples only, without saved responses or playground credentials."
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "",
      "type": "string"
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "api-key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Health Check",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/healthz",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "healthz"
          ],
          "query": [],
          "variable": []
        },
        "description": "Public connection check. A successful response verifies API availability and does not validate your API key.",
        "auth": {
          "type": "noauth"
        }
      },
      "response": []
    },
    {
      "name": "Export Units",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept-Language",
            "value": ""
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/units/export/all",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "units",
            "export",
            "all"
          ],
          "query": [
            {
              "key": "statuses",
              "value": "Available",
              "disabled": true,
              "description": "Unit statuses, case-sensitive (e.g., `Available`). Repeat the parameter for multiple values. Without it, the export returns the same unit statuses as `GET /external/apis/v1.0/units`."
            },
            {
              "key": "brokerId",
              "value": "6aaa653020fd7406492f0554",
              "disabled": true,
              "description": "Broker organization ID. Returns only units that are visible to brokers and assigned to this broker."
            },
            {
              "key": "dateFilterBy",
              "value": "",
              "disabled": true,
              "description": "Date field to filter on. The date filter applies only when this is sent with `startDate`, `endDate`, or both."
            },
            {
              "key": "startDate",
              "value": "2026-09-01",
              "disabled": true,
              "description": "Returns units from the start of this day, in Egypt time (Africa/Cairo)."
            },
            {
              "key": "endDate",
              "value": "2026-09-30",
              "disabled": true,
              "description": "Returns units up to the end of this day, in Egypt time (Africa/Cairo)."
            },
            {
              "key": "sortBy",
              "value": "defaultSort",
              "disabled": true,
              "description": "Field to sort by. `defaultSort` sorts by `createdAt`."
            },
            {
              "key": "order",
              "value": "desc",
              "disabled": true,
              "description": "Sort order"
            }
          ],
          "variable": []
        },
        "description": "Returns all matching units in one response, without pagination. An export can return up to 10,000 units; if more units match, the API returns 400 and no units. Stored unit fields that have no value are omitted."
      },
      "response": []
    },
    {
      "name": "Get Compounds for Organization",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/compounds",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "compounds"
          ],
          "query": [
            {
              "key": "page",
              "value": "1",
              "disabled": true,
              "description": "The page number to retrieve"
            },
            {
              "key": "limit",
              "value": "10",
              "disabled": true,
              "description": "Number of items per page"
            },
            {
              "key": "all",
              "value": "0",
              "disabled": true,
              "description": "Return all results without pagination. 0 = paginated, 1 = all results"
            }
          ],
          "variable": []
        },
        "description": "Retrieves a paginated list of compounds for the organization with optional filtering and search capabilities"
      },
      "response": []
    },
    {
      "name": "Get Compound Units",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/compounds/:slug/units",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "compounds",
            ":slug",
            "units"
          ],
          "query": [],
          "variable": [
            {
              "key": "slug",
              "value": "",
              "description": "The compound slug identifier"
            }
          ]
        },
        "description": "Retrieves all units for a specific compound with detailed information including unit designs, amenities, property types, and phases"
      },
      "response": []
    },
    {
      "name": "Create or update lead",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "language",
            "value": "en-us"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/leads",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "leads"
          ],
          "query": [],
          "variable": []
        },
        "description": "Creates a lead from the old flat payload or the newer data payload. All request body fields are optional. If recordSystemId is supplied, Sakneen upserts by that exact organization-scoped external lead or submission ID. If recordSystemId is omitted, each request creates a new lead. data is accepted without PUBLIC_CREATE_LEAD form validation, and values in data win over duplicate flat fields. additionalData is stored separately from lead data and merged across updates. leadSource is used only when the caller sends data.leadSource. The server validates duplicate phoneNumber and phoneNumber2 values with the same admin/sales rules; duplicate-phone validation is skipped when the organization allows conflict leads and returns 400 otherwise. When project is supplied, Sakneen links existing organization compounds whose translated name matches the project value case-insensitively for the request language. The server does not accept compound IDs and does not create compounds from this endpoint. Successful writes are logged as External Lead Create or External Lead Update with modifier External API and source API.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Jane Smith\",\n  \"phoneNumber\": \"+201001234567\",\n  \"email\": \"jane@example.com\",\n  \"project\": \"North Coast\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "Create or update a unit",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/units",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "units"
          ],
          "query": [],
          "variable": []
        },
        "description": "Create a new property unit or update an existing one in the system",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"recordSystemId\": \"00163EAB688B1EECA9C3E1F963E029CC\",\n  \"unitId\": \"VH-12\",\n  \"price\": 12000,\n  \"bua\": 120,\n  \"propertyType\": \"apartment\",\n  \"status\": \"available\",\n  \"bedrooms\": 2,\n  \"bathrooms\": 2,\n  \"landAres\": 120,\n  \"finishingType\": \"Fully finished\",\n  \"deliveryDateType\": \"months\",\n  \"deliveryDate\": \"01-12-2026\",\n  \"deliveryDateMonths\": 25,\n  \"floor\": \"ground\",\n  \"amenities\": [\n    \"wifi\",\n    \"parking\"\n  ],\n  \"features\": [\n    \"parking\"\n  ],\n  \"saleType\": \"primary\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "Create or Update Reservation",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "language",
            "value": "en-us"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/reservations",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "reservations"
          ],
          "query": [],
          "variable": []
        },
        "description": "Accept a reservation create/update request from an external system and queue it for asynchronous processing. A 201 response with `{ \"ok\": true }` means the request was accepted. If the unit cannot be resolved during processing, Sakneen still creates or updates the reservation without a local unit link. Other processing failures are tracked internally by Sakneen's Google Cloud Tasks-backed queue ledger and operational notifications.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"recordSystemId\": \"RES-001\",\n  \"unitRecordSystemId\": \"UNIT-001\",\n  \"status\": \"approved\",\n  \"fullName\": \"Palm Hills Client\",\n  \"phoneNumber\": \"+201001234567\",\n  \"email\": \"client@example.com\",\n  \"reservationAmount\": 150000,\n  \"crmOpportunityId\": \"OPP-456\",\n  \"salesPersonEmail\": \"sales@example.com\",\n  \"reservationData\": {\n    \"paymentPlan\": \"5 years\",\n    \"source\": \"external-crm\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "Reservation Webhook",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/reservations/webhook",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "reservations",
            "webhook"
          ],
          "query": [],
          "variable": []
        },
        "description": "Apply a receipt update to an existing reservation cheque. Receipt status mappings are configured per organization; obtain the supported values from Sakneen support. This changes wallet/receipt data.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reservationId\": \"000000000000000000000001\",\n  \"chequeId\": \"000000000000000000000002\",\n  \"receiptId\": \"sample-receipt-001\",\n  \"receiptAmount\": 100,\n  \"receiptStatus\": \"CONFIRMED\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": []
    },
    {
      "name": "Delete lead",
      "request": {
        "method": "DELETE",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/external/apis/v1.0/leads/:recordSystemId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "external",
            "apis",
            "v1.0",
            "leads",
            ":recordSystemId"
          ],
          "query": [],
          "variable": [
            {
              "key": "recordSystemId",
              "value": "",
              "description": "Stable external lead or submission ID used when upserting the lead."
            }
          ]
        },
        "description": "Soft deletes a non-deleted lead by organization-scoped external lead or submission ID, and soft deletes its linked lead actions. Returns 404 when no matching non-deleted lead exists. Successful deletes are logged as External Lead Delete with modifier External API and source API."
      },
      "response": []
    }
  ]
}
