> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.claw-ops.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.claw-ops.com/_mcp/server.

# 모바일 게이트웨이 콜홈 enroll (익명 · enroll 토큰 인증)

POST https://api.claw-ops.com/v1/mobile-gateways/enroll
Content-Type: application/json

박스 control-agent 가 로컬 생성한 WireGuard 공개키로 콜홈한다. 인증은 계정 세션이 아니라 `Authorization: Bearer <enroll_token>`(발급받은 1회용 토큰). 성공 시 터널 IP 를 할당하고 게이트웨이를 등록(status=active)한 뒤, 박스가 wg0.conf 를 완성할 터널 설정을 반환한다. 개인키는 박스 밖으로 나가지 않는다(공개키만 전송).

Reference: https://docs.claw-ops.com/api-레퍼런스/claw-ops-api/mobile-gateways/enroll-mobile-gateway

## Request

### Body (application/json)

- `wgPubkey` (string, required) — 박스가 로컬 생성한 WireGuard 공개키(base64 44자).
- `msisdn` (string, optional) — 박스 휴대폰 E.164/국내번호(관측/표시용, 신뢰하지 않음).

## Response

### 201

enroll 성공 — 터널 설정

- `tunnelIp` (string, required) — 할당된 터널 /32 주소(박스 [Interface] Address).
- `tunnelCidr` (string, required)
- `kamailioIp` (string, required) — SIP 시그널링 대상(박스 AllowedIPs + pjsip 트렁크 host).
- `rtpengineIp` (string, required)
- `rtpPortRange` (string, required)
- `wgGwEndpoint` (string, required) — WireGuard 게이트웨이 endpoint(공인 IP:51820). 박스 [Peer] Endpoint.
- `wgGwPubkey` (string, required) — WireGuard 게이트웨이 공개키. 박스 [Peer] PublicKey.
- `keepalive` (integer, required) — PersistentKeepalive(초). NAT 뒤 개시 유지.

## Examples

**Request**

```json
{
  "wgPubkey": "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw="
}
```

**Response**

```json
{
  "tunnelIp": "10.9.0.3",
  "tunnelCidr": "10.9.0.0/16",
  "kamailioIp": "10.0.1.3",
  "rtpengineIp": "10.0.1.4",
  "rtpPortRange": "10000-20000",
  "wgGwEndpoint": "34.1.2.3:51820",
  "wgGwPubkey": "iAQgnt3AAZuG9oGPVwmN82oXDkagjYXKSyNHDaO6S0c=",
  "keepalive": 25
}
```

**SDK Code**

```python
import requests

url = "https://api.claw-ops.com/v1/mobile-gateways/enroll"

payload = { "wgPubkey": "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.claw-ops.com/v1/mobile-gateways/enroll';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"wgPubkey":"HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw="}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.claw-ops.com/v1/mobile-gateways/enroll"

	payload := strings.NewReader("{\n  \"wgPubkey\": \"HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	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://api.claw-ops.com/v1/mobile-gateways/enroll")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"wgPubkey\": \"HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=\"\n}"

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.post("https://api.claw-ops.com/v1/mobile-gateways/enroll")
  .header("Content-Type", "application/json")
  .body("{\n  \"wgPubkey\": \"HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.claw-ops.com/v1/mobile-gateways/enroll', [
  'body' => '{
  "wgPubkey": "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw="
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.claw-ops.com/v1/mobile-gateways/enroll");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"wgPubkey\": \"HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw=\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["wgPubkey": "HIgo9xNzJMWLKASShiTqIybxZ0U3wGLiUeJ1PKf8ykw="] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.claw-ops.com/v1/mobile-gateways/enroll")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```