HydraCore
API by router

Whatsapp embedded signup

Embedded Signup Callback

Handle Meta OAuth callback after Embedded Signup.

  1. Verify state parameter (CSRF protection)
  2. Exchange code for long-lived access token
  3. Fetch WABA and phone number details
  4. Create channel_endpoint + encrypted credentials
  5. Return success with phone number info
GET
/v1/channels/whatsapp/callback

Query Parameters

codeCode
stateState

Response Body

curl -X GET "https://loading/v1/channels/whatsapp/callback?code=string&state=string"
{
  "display_phone": "string",
  "error": "string",
  "instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
  "phone_number_id": "string",
  "success": true,
  "waba_id": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Initiate Embedded Signup

Generate Meta OAuth URL for Embedded Signup.

Returns the URL the frontend should redirect to. The state parameter is stored server-side to prevent CSRF on the callback.

POST
/v1/instances/{instance_id}/channels/whatsapp/connect
AuthorizationBearer <token>

In: header

Path Parameters

instance_idInstance Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key

Response Body

curl -X POST "https://loading/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/channels/whatsapp/connect" \  -H "X-Api-Key: string"
{
  "oauth_url": "string",
  "state": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}