> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wave.sa/llms.txt
> Use this file to discover all available pages before exploring further.

# البدء السريع

> أجرِ أوّل Web Callback لك في أقلّ من 5 دقائق.

## احصل على sandbox API key

1. سجّل في wave.sa وأكمِل التحقّق من الهويّة عبر Nafath.
2. سجّل الدخول إلى لوحة التحكّم وافتح API Keys.
3. انسخ الـ sandbox key الخاصّ بك — يبدأ بـ `sk_sandbox_`.

<Warning>
  تعامَل مع الـ key الخاصّ بك كأنّه كلمة مرور. يُعرَض مرّة واحدة فقط عند الإنشاء؛ وإن فقدته، فاستخدم Revoke & Regenerate في لوحة التحكّم.
</Warning>

## أجرِ callback

أرسِل رقم وجهة إلى `POST /v1/callback`:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wave.sa/v1/callback \
    -H "Authorization: Bearer sk_sandbox_xxxxxxxxxxxx" \
    -H "Content-Type: application/json" \
    -d '{ "to": "+966500000000" }'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch("https://api.wave.sa/v1/callback", {
    method: "POST",
    headers: {
      Authorization: "Bearer sk_sandbox_xxxxxxxxxxxx",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ to: "+966500000000" }),
  });
  const data = await res.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  res = requests.post(
      "https://api.wave.sa/v1/callback",
      headers={"Authorization": "Bearer sk_sandbox_xxxxxxxxxxxx"},
      json={"to": "+966500000000"},
  )
  print(res.json())
  ```
</CodeGroup>

## اقرأ الاستجابة

يُعيد الطلب الناجح `202 Accepted`:

```json theme={null}
{
  "call_id": "call_abc123",
  "status": "initiated",
  "sandbox": true,
  "vitalpbx_channel_id": "…",
  "created_at": "2026-06-17T10:00:00.000Z"
}
```

<Note>
  الـ `status` هو `initiated` — لقد أجرت Wave المكالمة. أمّا الحالات النهائيّة (`answered`/`ended`) فلا تُصدَر بعد. راجع دورة حياة المكالمة.
</Note>

## الخطوات التالية

<CardGroup cols={2}>
  <Card title="وضع الـ Sandbox" icon="flask" href="/ar/sandbox-mode">
    نافذة التجربة، وقفل الوجهة، وأرقام الاختبار.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/ar/webhooks">
    استقبل أحداث المكالمات على الـ endpoint الخاصّ بك.
  </Card>
</CardGroup>
