# buyDialingPoolNumbers

Buy phone numbers straight into the bulk-dialing rotation: each is a RECURRING monthly charge. Either `count` (with an optional preferred `areaCode`; the provider picks) or `phoneNumbers` (E.164s from searchAvailablePhoneNumbers; a number taken meanwhile is a shortfall, never swapped). A number past the plan's included numbers adds $5/mo and is refused unless `confirmExtraPhoneNumberCharge` is true, sent only once the person agreed to that charge. `purchaseAttemptKey`: mint ONE per intended purchase and resend it unchanged on every retry, so a lost response never buys twice. Returns addedLines and, when some failed, failure { failedCount, message, kind }. ADMIN: the key owner must currently be an org admin.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "buyDialingPoolNumbers", "variables": {...} }`
- Scope: `ADMIN`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `purchaseAttemptKey`: `String!` (required)
- `count`: `Int`
- `phoneNumbers`: `[String!]`
- `areaCode`: `Int`
- `confirmExtraPhoneNumberCharge`: `Boolean`

## Response (data, an example)

```json
{
  "dialingPoolMutation": {
    "purchaseNumbersIntoPool": {
      "addedLines": [
        {
          "id": "<ID>",
          "e164Number": "…"
        }
      ],
      "failure": {
        "failedCount": 0,
        "message": "…",
        "kind": "NOTHING_BOUGHT"
      }
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "buyDialingPoolNumbers",
    "variables": {
      "purchaseAttemptKey": "<String>"
    }
  }'
```
