إنشاء جلسة واتساب جديدة
تجهيز حاوية برمجية مخصصة لربط رقم جديد بالمنصة.
تسجيل الدخول مطلوب
سجل الدخول لاستبدال المعرفات (Instance ID) ورمز الوصول (Access Token) بمعلومات حسابك الحقيقي لاختبار ال API مباشرة.
تسجيل الدخوللا توجد معاملات استعلام مطلوبة
هذه النهاية الطرفية لا تتوقع بيانات في الرابط.
توصيات
Provision sessions 'On-Demand' to keep your dashboard clean and maximize your quota usage.
Always follow a Create call with a Start call to initiate the QR code generation process.
Ensure your database schema can handle 12-character alphanumeric strings for the 'instance_id'.
Provisioning Your Digital Infrastructure: The Create Session Endpoint
The /v2/session/create endpoint is the specialized "Factory" for Wawp instances. While it may seem like a simple registration step, it handles a sophisticated backend process of resource allocation, container provisioning, and server assignment. Understanding how to use this factory efficiently is the foundation of a scalable WhatsApp integration.
🛠️ The Provisioning Architecture
When you call create, Wawp does not just create a record in a database; it orchestrates the following:
- Node Selection: Our balancer identifies the high-performance node with the lowest latency and highest availability for your region.
- Instance Isolation: A dedicated, isolated environment is carved out for your session, ensuring that your data and encryption keys never mingle with other users.
- Identifier Assignment: You are issued a unique
instance_id, which serves as your permanent handle for all future interactions with that specific WhatsApp account.
🛡️ Strategic Best Practices
1. Data Integrity and Persistence
Always save the returned instance_id and server_name in your local database immediately.
- The "Context Store": Associate this ID with your internal User IDs or Business IDs.
- Troubleshooting: If you ever need to contact support, providing the
server_nameallows our engineers to pinpoint the exact infrastructure node hosting your session, reducing resolution time from hours to minutes.
2. Idempotency and Deduplication
Before calling create, always check your own system state.
- The Trap: Re-creating instances every time a user refreshes their settings page will quickly exhaust your quota.
- The Solution: Implement a "Check-then-Create" logic. Only call this endpoint if your database shows that the user has no existing
instance_idor if they have explicitly requested to "Delete and Start New."
3. "Lazy" Provisioning
Don't create sessions in bulk. Provision an instance only when a user is actively "Onboarding." This maintains a clean environment and ensures that your allocated resources are being used by active, paying, or engaged customers.
💡 Industry-Standard Use Cases
A. Customer Relationship Management (CRM)
Automatically provision a unique WhatsApp instance for every new high-value account. This allows your sales team to have dedicated communication channels that are fully logged and auditable within your CRM.
B. Automated Appointment Reminders
For medical or service industries, use this endpoint to spin up "Notification Engines." By separating "Notifications" from "Customer Support" across different instances, you reduce the risk of account flagging and ensure high delivery rates.
C. Multi-Tenant SaaS Platforms
If you build software for other businesses, you can use this endpoint to offer "WhatsApp-as-a-Service" to your clients. Each of your clients gets their own instance_id, giving them a private, secure connection to their own customers.
⚠️ Common Pitfalls and Troubleshooting
"quota_reached" (403 Forbidden)
This is the most common error for growing applications. It means you have used all the "slots" provided by your current plan.
- Fix: Either upgrade your plan or use the
/v2/session/deleteendpoint to remove stagnant or unused sessions.
"missing_param" (400 Bad Request)
The "Factory" cannot verify your identity without the access_token.
- Fix: Ensure your token is included in the request body (POST). Double-check for trailing spaces or hidden characters if copying from a dashboard.
🚀 The Next Step: "The Warm Boot"
Creating a session is like "registering a car." You now have the keys, but the engine isn't running yet. Your newly created session will be in the STOPPED state. To actually start the authentication process and generate a QR code, you must call the /v2/session/start endpoint immediately after success.
البارامترات
قم بتهيئة المعاملات المطلوبة للتفاعل مع نقطة النهاية هذه. جميع وسائط الاستعلام والبيانات مدرجة أدناه مع تفاصيلها.
محتوى الطلب
يرسل كـ JSONstring | Your API Access Token مثال: | ||
string | — | WhatsApp phone number with international country code (e.g., 201012345678). Strongly recommended to ensure optimal server routing, session continuity, and account protection. مثال: |
برمج بالذكاء الاصطناعي باستخدام Wawp MCP
MCP READYقم بربط الـ API مباشرة مع Cursor أو Windsurf أو Claude Desktop، ودع الذكاء الاصطناعي يكتب لك كود الربط وينفذه تلقائياً!
أمثلة الكود
استخدم أمثلة الكود الجاهزة لدمج واجهة برمجة التطبيقات (API) في مشروعك بسرعة وكفاءة. اختر لغة البرمجة والمكتبة التي تفضلها.
الردود المتوقعة
استكشف كافة الردود والنتائج المحتملة من الخادم. قمنا بتوثيق كل كود حالة (Status Code) مع أمثلة للبيانات لتسهيل معالجة الأخطاء والنجاح.
Command Palette
Search for a command to run...