{
  "openapi": "3.1.0",
  "info": {
    "title": "CaseDaleel public information API",
    "version": "1.0.0",
    "summary": "Read-only access to CaseDaleel's published UAE legal FAQ, guides and professional listing.",
    "description": "Read-only, unauthenticated endpoints returning content already published on casedaleel.com: FAQ search, guide list, guide text, what CaseDaleel is and is not, and the opt-in list of licence-checked legal professionals. No user or case data. Every response carries the canonical source_url to cite and the line \"General information, not legal advice. CaseDaleel is not a law firm.\" Rate limited to 60 requests per minute per client. The same capabilities are available as an MCP server at https://casedaleel.com/mcp.",
    "contact": {
      "name": "CaseDaleel",
      "email": "contact@casedaleel.com",
      "url": "https://casedaleel.com/contact/"
    },
    "termsOfService": "https://casedaleel.com/en/terms/"
  },
  "servers": [
    {
      "url": "https://casedaleel.com"
    }
  ],
  "paths": {
    "/api/public/faq": {
      "get": {
        "operationId": "searchFaq",
        "summary": "Search the UAE legal FAQ",
        "description": "Keyword search over CaseDaleel's FAQ (salary and gratuity, rent and eviction, cheques and debt, family, hiring a lawyer, the platform). Returns matching Q&As with canonical URLs and the official authority to verify against.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "The question or keywords, e.g. \"unpaid salary deadline\".",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "en (English) or ar (Arabic).",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ar"
              ],
              "default": "en"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum results, 1–10.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching FAQ entries (possibly none).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FaqSearchResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/guides": {
      "get": {
        "operationId": "listGuides",
        "summary": "List published guides",
        "description": "Titles, one-line summaries, dates and URLs of CaseDaleel's UAE preparation guides and fictional composite case studies.",
        "responses": {
          "200": {
            "description": "Guide list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "guides": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GuideSummary"
                      }
                    },
                    "source_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Canonical page to cite."
                    },
                    "disclaimer": {
                      "type": "string",
                      "description": "Always \"General information, not legal advice. CaseDaleel is not a law firm.\" (Arabic results append an Arabic translation)."
                    }
                  },
                  "required": [
                    "guides",
                    "source_url",
                    "disclaimer"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/guides/{slug}": {
      "get": {
        "operationId": "getGuide",
        "summary": "Get one guide's full text",
        "description": "Full Markdown text of one guide or composite case study, by slug from listGuides.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Slug from listGuides.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,120}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Guide"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/professionals": {
      "get": {
        "operationId": "listPublicProfessionals",
        "summary": "List opted-in, licence-checked legal professionals",
        "description": "Independently licensed UAE advocates and legal consultants who chose to be listed, whose licence CaseDaleel checked by hand against the issuing authority's public register, and whose licence has not expired. Profiles carry no licence number, email, phone or links: a client reaches a professional only through a consented introduction on casedaleel.com. Order is a daily rotation, not a ranking. Licences are checked by hand against the issuing authority’s public register on the date shown. That is not an endorsement or a quality rating, CaseDaleel takes no commission on fees or outcomes, and you should confirm the licence yourself before instructing anyone. Rate limited to 60 requests per minute per client; responses are cached for 5 minutes.",
        "parameters": [
          {
            "name": "area",
            "in": "query",
            "required": false,
            "description": "Practice area code.",
            "schema": {
              "type": "string",
              "enum": [
                "employment",
                "family",
                "rental",
                "real_estate",
                "commercial",
                "criminal",
                "debt_recovery",
                "immigration",
                "inheritance",
                "personal_injury",
                "banking",
                "corporate"
              ]
            }
          },
          {
            "name": "emirate",
            "in": "query",
            "required": false,
            "description": "Emirate name (case-insensitive).",
            "schema": {
              "type": "string",
              "enum": [
                "Dubai",
                "Abu Dhabi",
                "Sharjah",
                "Ajman",
                "Umm Al Quwain",
                "Ras Al Khaimah",
                "Fujairah"
              ]
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Language code, or its English name (e.g. \"ar\" or \"Arabic\").",
            "schema": {
              "type": "string",
              "examples": [
                "ar",
                "en",
                "hi",
                "ur",
                "ml",
                "ta",
                "bn",
                "tl",
                "fa",
                "ru",
                "fr",
                "zh"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum results, 1–24 (larger values are clamped to 24).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching listed professionals (possibly none). With no database configured, available is false and the list is empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfessionalListing"
                }
              }
            }
          },
          "400": {
            "description": "Unknown filter value.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "const": "INVALID_FILTER"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "const": "RATE_LIMITED"
                    },
                    "retryAfter": {
                      "type": "integer",
                      "description": "Seconds to wait."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Listing temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "const": "UNAVAILABLE"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/public/about": {
      "get": {
        "operationId": "getAbout",
        "summary": "What CaseDaleel is and is not",
        "description": "Plain statement of the service: not a law firm, no referral commission, no outcome promise; who it is for; when a licensed advocate is needed; how to start; contact.",
        "responses": {
          "200": {
            "description": "About CaseDaleel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/About"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FaqEntry": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "topic_id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Canonical FAQ section to cite."
          },
          "official_source": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "related_guides": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "relevance": {
            "type": "number"
          }
        },
        "required": [
          "question",
          "answer",
          "url"
        ]
      },
      "FaqSearchResult": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "ar"
            ]
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FaqEntry"
            }
          },
          "source_url": {
            "type": "string",
            "format": "uri",
            "description": "Canonical page to cite."
          },
          "disclaimer": {
            "type": "string",
            "description": "Always \"General information, not legal advice. CaseDaleel is not a law firm.\" (Arabic results append an Arabic translation)."
          }
        },
        "required": [
          "results",
          "source_url",
          "disclaimer"
        ]
      },
      "GuideSummary": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "guide",
              "composite-case-study"
            ],
            "description": "composite-case-study = fictional learning example, not a real client or outcome."
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "ar"
            ]
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "date_published": {
            "type": [
              "string",
              "null"
            ]
          },
          "date_modified": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "kind",
          "title",
          "summary",
          "url"
        ]
      },
      "Guide": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GuideSummary"
          },
          {
            "type": "object",
            "properties": {
              "body_markdown": {
                "type": "string"
              },
              "source_url": {
                "type": "string",
                "format": "uri",
                "description": "Canonical page to cite."
              },
              "disclaimer": {
                "type": "string",
                "description": "Always \"General information, not legal advice. CaseDaleel is not a law firm.\" (Arabic results append an Arabic translation)."
              }
            },
            "required": [
              "body_markdown",
              "source_url",
              "disclaimer"
            ]
          }
        ]
      },
      "About": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "what_it_is": {
            "type": "string"
          },
          "who_it_is_for": {
            "type": "string"
          },
          "what_it_is_not": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "when_you_need_a_licensed_professional": {
            "type": "string"
          },
          "how_to_start": {
            "type": "string"
          },
          "contact": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string"
              },
              "page": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uri"
            }
          },
          "source_url": {
            "type": "string",
            "format": "uri",
            "description": "Canonical page to cite."
          },
          "disclaimer": {
            "type": "string",
            "description": "Always \"General information, not legal advice. CaseDaleel is not a law firm.\" (Arabic results append an Arabic translation)."
          }
        },
        "required": [
          "what_it_is",
          "what_it_is_not",
          "source_url",
          "disclaimer"
        ]
      },
      "PublicProfessional": {
        "type": "object",
        "description": "Built from a fixed whitelist of fields. No licence number, contact details or links.",
        "properties": {
          "display_name": {
            "type": "string"
          },
          "firm": {
            "type": [
              "string",
              "null"
            ]
          },
          "practitioner_type": {
            "type": "string",
            "enum": [
              "advocate",
              "legal_consultant",
              "other"
            ]
          },
          "practitioner_type_label": {
            "type": "string"
          },
          "emirates": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Dubai",
                "Abu Dhabi",
                "Sharjah",
                "Ajman",
                "Umm Al Quwain",
                "Ras Al Khaimah",
                "Fujairah"
              ]
            }
          },
          "practice_areas": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "employment",
                "family",
                "rental",
                "real_estate",
                "commercial",
                "criminal",
                "debt_recovery",
                "immigration",
                "inheritance",
                "personal_injury",
                "banking",
                "corporate"
              ]
            }
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ar",
                "en",
                "hi",
                "ur",
                "ml",
                "ta",
                "bn",
                "tl",
                "fa",
                "ru",
                "fr",
                "zh"
              ]
            }
          },
          "years_experience": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bio": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 400
          },
          "licence_authority": {
            "type": [
              "string",
              "null"
            ],
            "description": "Authority that issued the licence."
          },
          "licence_checked_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date CaseDaleel checked the licence on the public register (Asia/Dubai)."
          }
        },
        "required": [
          "display_name",
          "practitioner_type",
          "emirates",
          "practice_areas",
          "languages"
        ]
      },
      "ProfessionalListing": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean",
            "description": "false when the listing has no database behind it."
          },
          "total": {
            "type": "integer",
            "description": "Listed professionals matching the filters."
          },
          "count": {
            "type": "integer",
            "description": "Profiles in this response."
          },
          "professionals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicProfessional"
            }
          },
          "filters": {
            "type": "object",
            "properties": {
              "area": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "emirate": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "language": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "limit": {
                "type": "integer"
              }
            }
          },
          "labels": {
            "type": "object",
            "description": "English labels for the codes used above.",
            "properties": {
              "practiceAreas": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "languages": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "practitionerTypes": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "available",
          "total",
          "count",
          "professionals",
          "note"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retry_after_seconds": {
            "type": "integer"
          },
          "disclaimer": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}
