Skip to content

    Arabic or English · ↑↓ to move · Enter to open · Esc to close

    العربية
    On this page

    Website button & WhatsApp links

    Website button statistics

    GET/v2/widgets/{widgetId}/stats
    • Scope:widgets:read
    • Idempotency-Key:not used
    • read only

    Impressions (only when enabled, sampled), clicks, attributed conversations and conversion rate — per day, page, utm source / medium, campaign, agent, device and referrer domain. Counts only.

    Request

    curl -X GET "https://mursilat.com/api/v2/widgets/widgetId/stats?from=2026-10-01&to=2026-10-14" \
      -H "Authorization: Bearer $WASLA_API_KEY"

    Send this request without a body.

    Response

    200Example

    200 — application/json
    {
      "range": {
        "from": "2026-10-01",
        "to": "2026-10-14",
        "tz": "Africa/Cairo"
      },
      "totals": {
        "impressions": null,
        "clicks": 40,
        "conversations": 12,
        "conversionRate": 0.3
      },
      "byDay": [
        {
          "day": "2026-10-14",
          "impressions": 0,
          "clicks": 3,
          "conversations": 1
        }
      ],
      "byPage": [
        {
          "key": "/products/bag",
          "clicks": 10,
          "conversations": 3
        }
      ],
      "bySource": [
        {
          "key": "facebook / cpc",
          "source": "facebook",
          "medium": "cpc",
          "clicks": 5,
          "conversations": 2
        }
      ],
      "byCampaign": [
        {
          "key": "summer",
          "clicks": 4,
          "conversations": 1
        }
      ],
      "byAgent": [
        {
          "key": "sales",
          "clicks": 4,
          "conversations": 1
        }
      ],
      "byDevice": [
        {
          "key": "mobile",
          "clicks": 30,
          "conversations": 9
        }
      ],
      "byReferrer": [
        {
          "key": "facebook.com",
          "clicks": 4,
          "conversations": 1
        }
      ]
    }

    Fields in this response

    Fields of the example answer. Expand objects and arrays.

    • responseobject9 fields
      • rangeobject3 fields
        • fromstring "2026-10-01"
        • tostring "2026-10-14"
        • tzstring "Africa/Cairo"
      • totalsobject4 fields
        • impressionsnull null
        • clicksinteger 40
        • conversationsinteger 12
        • conversionRatenumber 0.3
      • byDayarray1 items
        • [0]object4 fields
          • daystring "2026-10-14"
          • impressionsinteger 0
          • clicksinteger 3
          • conversationsinteger 1
      • byPagearray1 items
        • [0]object3 fields
          • keystring "/products/bag"
          • clicksinteger 10
          • conversationsinteger 3
      • bySourcearray1 items
        • [0]object5 fields
          • keystring "facebook / cpc"
          • sourcestring "facebook"
          • mediumstring "cpc"
          • clicksinteger 5
          • conversationsinteger 2
      • byCampaignarray1 items
        • [0]object3 fields
          • keystring "summer"
          • clicksinteger 4
          • conversationsinteger 1
      • byAgentarray1 items
        • [0]object3 fields
          • keystring "sales"
          • clicksinteger 4
          • conversationsinteger 1
      • byDevicearray1 items
        • [0]object3 fields
          • keystring "mobile"
          • clicksinteger 30
          • conversationsinteger 9
      • byReferrerarray1 items
        • [0]object3 fields
          • keystring "facebook.com"
          • clicksinteger 4
          • conversationsinteger 1

    Parameters

    Path

    NameTypeConstraintsDescription
    widgetIdrequiredTypestringConstraints—DescriptionWebsite button id (wgt_…).

    Query

    NameTypeConstraintsDescription
    fromoptionalTypestringConstraints—DescriptionYYYY-MM-DD (default: 30 days before to).
    tooptionalTypestringConstraints—DescriptionYYYY-MM-DD (default: today); at most 92 days.
    tzoptionalTypestringConstraints—DescriptionIANA time zone of the days (default Africa/Cairo).

    Headers

    NameTypeConstraintsDescription
    X-Request-IdoptionalTypestringConstraints—DescriptionOptional: your own request id, echoed back (otherwise we generate req_…). Quote it to support.

    Errors

    Besides the authentication, rate-limit and validation errors every endpoint can return:

    • 404 · WIDGET_NOT_FOUND — Website button not found.

      Check the widgetId (GET /v2/widgets).

      Correct the cause before repeating the request.

      HTTP 404 · application/json
      {
        "error": {
          "code": "WIDGET_NOT_FOUND",
          "message": "Website button not found.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#WIDGET_NOT_FOUND",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 400 · STATS_RANGE_INVALID — Invalid date range.

      YYYY-MM-DD, ≤ 92 days.

      Correct the cause before repeating the request.

      HTTP 400 · application/json
      {
        "error": {
          "code": "STATS_RANGE_INVALID",
          "message": "Invalid date range.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#STATS_RANGE_INVALID",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 403 · SCOPE_REQUIRED — The key lacks the scope of this endpoint.

      Add the scope in details.required to the key.

      Correct the cause before repeating the request.

      HTTP 403 · application/json
      {
        "error": {
          "code": "SCOPE_REQUIRED",
          "message": "The key lacks the scope of this endpoint.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#SCOPE_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 401 · API_KEY_REQUIRED — No API key was sent.

      Send Authorization: Bearer wsl_live_…

      Correct the cause before repeating the request.

      HTTP 401 · application/json
      {
        "error": {
          "code": "API_KEY_REQUIRED",
          "message": "No API key was sent.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#API_KEY_REQUIRED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 401 · API_KEY_INVALID — The API key is not valid.

      Copy the key again from Settings → API keys (it is shown only once; create a new one if lost).

      Correct the cause before repeating the request.

      HTTP 401 · application/json
      {
        "error": {
          "code": "API_KEY_INVALID",
          "message": "The API key is not valid.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#API_KEY_INVALID",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors
    • 429 · RATE_LIMITED — Rate limit of this key reached.

      Wait Retry-After seconds; watch X-RateLimit-Remaining.

      Retry after addressing the cause.

      HTTP 429 · application/json
      {
        "error": {
          "code": "RATE_LIMITED",
          "message": "Rate limit of this key reached.",
          "docsUrl": "https://mursilat.com/developers/v2/errors#RATE_LIMITED",
          "requestId": "req_6604bedc8c489f20e582691a"
        }
      }
      Errors

    Errors →

    Try it

    Send this request from your browser to the Mursilat API.

    documented example

    Preview — this copy of the docs isn’t on mursilat.com, so the console shows the documented example instead of calling the API.

    Real requests use your real number and plan: they can send WhatsApp messages, spend quota and delete data. (read only)

    Kept only in this tab’s memory: never saved, never put in the URL, sent only to mursilat.com. Reloading the page forgets it.

    Path parameters
    Query parameters

    Send this request for real?

    GET /v2/widgets/{widgetId}/stats