> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# Connect a WhatsApp business number

> Connect a Meta-verified WhatsApp business number to your SignalWire Space during the early-access alpha.

Your SignalWire account connects to WhatsApp through your existing Facebook/Meta Business account.
Once connected, your WhatsApp business numbers appear in your Space and can be used as the
`from` address in the [Messaging API](/docs/platform/messaging/whatsapp/send-messages).

WhatsApp on SignalWire is in **early-access alpha** and is enabled per Space. The steps below are
coordinated with your SignalWire representative. Number provisioning is not yet self-serve. See the
[overview](/docs/platform/messaging/whatsapp) for what's included in the alpha.

## Prerequisites

* A **Meta Business Account** (Facebook/Meta Business).
* A **SignalWire Space** with WhatsApp alpha access enabled.
* SignalWire **project credentials**: your Project ID and an API key with the `numbers` scope. You'll
  find these in your [SignalWire Dashboard](https://my.signalwire.com).

## Connect your account

### Request alpha access

WhatsApp access is gated at the Space level. [Request early access through this
form](https://signalwire.typeform.com/to/EyPVZ1St) to have the feature enabled for your Space and
begin onboarding.

### Complete Meta embedded signup

SignalWire uses Meta's **embedded signup** flow to link your WhatsApp Business Account (WABA) to
your SignalWire Space. During this flow you authorize the connection with Meta and select the
business phone number(s) to register.

### Confirm your numbers

After signup completes, your registered WhatsApp numbers appear in your Space, associated with your
WhatsApp Business Account. Confirm they're present before sending messages.

During the alpha, adding or removing WhatsApp numbers is handled on request by the SignalWire team,
or directly via the Meta Business dashboard. It cannot be done programmatically through the API or the
customer-facing SignalWire Dashboard at this time.

## Verify the connection

List the WhatsApp Business Accounts connected to your Space:

### Request

GET https\://%7BYour\_Space\_Name%7D.signalwire.com/api/messaging/whatsapp/businesses

```curl
curl https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses \
     -u "<project_id>:<api_token>"
```

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses"

response = requests.get(url, auth=("<project_id>", "<api_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses';
const credentials = btoa("<project_id>:<api_token>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<project_id>", "<api_token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<project_id>", "<api_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses")
  .basicAuth("<project_id>", "<api_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses', [
  'headers' => [
  ],
    'auth' => ['<project_id>', '<api_token>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses");
client.Authenticator = new HttpBasicAuthenticator("<project_id>", "<api_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<project_id>:<api_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/businesses")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

And list the WhatsApp numbers available to use as a `from` address:

### Request

GET https\://%7BYour\_Space\_Name%7D.signalwire.com/api/messaging/whatsapp/numbers

```curl
curl https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers \
     -u "<project_id>:<api_token>"
```

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers"

response = requests.get(url, auth=("<project_id>", "<api_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers';
const credentials = btoa("<project_id>:<api_token>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<project_id>", "<api_token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<project_id>", "<api_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers")
  .basicAuth("<project_id>", "<api_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers', [
  'headers' => [
  ],
    'auth' => ['<project_id>', '<api_token>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers");
client.Authenticator = new HttpBasicAuthenticator("<project_id>", "<api_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<project_id>:<api_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/messaging/whatsapp/numbers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Response (200)

```json
{
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "business_phone_number_id": "102290129340398",
      "phone_number": "whatsapp:+15557654321",
      "calling_handler_resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "messaging_handler_resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "business_name": "Acme, Inc.",
      "waba_id": "109876543210987",
      "whatsapp_business_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "voice_enabled": false,
      "voice_capable": false,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ]
}
```

Each number record includes its association with a WhatsApp Business Account, voice-capability flags,
and the resource IDs used for routing calls or messages through SignalWire. See the
[List WhatsApp numbers](/docs/apis/rest/whatsapp/list-whatsapp-numbers) and
[List WhatsApp Business Accounts](/docs/apis/rest/whatsapp/list-whatsapp-businesses) reference for the
full response schemas.

## Next steps

#### [Send messages](/docs/platform/messaging/whatsapp/send-messages)

Send text, media, interactive, and template messages over WhatsApp.

#### [Message templates](/docs/platform/messaging/whatsapp/message-templates)

Create and manage the Meta-approved templates required to start conversations.