# Create a connection list in an existing package; no GB purchase

`POST /account/api/v1/residential/lists/create`

## Authorization

`Authorization: Bearer YOUR_ARNPROXY_API_KEY`

`Accept: application/json`

Required permission: `residential_management`

`Content-Type: application/json`

`Idempotency-Key` · 16–100 letters, digits, _ or -. Persist and reuse the same value for the same operation.

## Parameters

| Name | Type | Required / Conditional | Default | Description |
|---|---|---|---|---|
| `Idempotency-Key` (header) | string | Required | — | 16–100 letters/digits/_/-. Keep the same value for the operation/status; do not reuse with a different body. |
| `package_id` (body) | integer | Required | — | ARNPROXY package ID from residential_packages, never a supplier package_key. |
| `title` (body) | string | Required | — | Non-empty UTF-8 text, up to 255 bytes; no control characters, < or >. |
| `country` (body) | string | Required | — | Two uppercase country-code letters, e.g. US. |
| `region` (body) | string | Optional | `""` | Optional location text, at most 50 UTF-8 bytes; defaults to empty. |
| `city` (body) | string | Optional | `""` | Optional location text, at most 50 UTF-8 bytes; defaults to empty. |
| `isp` (body) | string | Optional | — | ISP text from the location response, up to 50 UTF-8 bytes. |
| `port_count` (body) | integer | Required | — | 1–1000 connection ports. |
| `rotation_seconds` (body) | integer | Required | — | -1–3600 integer seconds, following the existing list rotation values. |
| `expected_revision` (body) | string | Required | — | revision from this operation’s scope/settings read: 64 lowercase hex characters. |
| `terms` (body) | boolean | Required | — | Must be the JSON boolean true for explicit approval, not the string "true". |
| `authentication` (body) | string | Optional | `"login_password"` | login_password or ip_auth. |
| `authorized_ips` (body) | string[] | Conditional | — | Only with authentication=ip_auth: 1–20 unique public IPv4 addresses. Omit for login_password. |

## Request body

Replace YOUR_/FROM_ placeholders with values from the relevant catalog, quote or scope. Examples leave consent false; only approve a real operation intentionally.

```json
{
  "package_id": "YOUR_PACKAGE_ID",
  "title": "My connection list",
  "country": "US",
  "port_count": 1,
  "rotation_seconds": 0,
  "expected_revision": "FROM_SCOPE_REVISION",
  "terms": false
}
```

## Request example

### curl

```curl
printf 'Authorization: Bearer %s\n' "$ARNPROXY_API_KEY" |
  curl --silent --show-error --header @- \
    --header 'Accept: application/json' \
    --connect-timeout 10 --max-time 30 \
    --header 'Idempotency-Key: YOUR_SAVED_OPERATION_KEY' \
    --request POST --header 'Content-Type: application/json' \
    --data-binary @request.json \
    'https://www.arnproxy.com/account/api/v1/residential/lists/create'
```

### python

```python
import os, requests

headers = {"Authorization": "Bearer " + os.environ["ARNPROXY_API_KEY"]}
headers["Idempotency-Key"] = "YOUR_SAVED_OPERATION_KEY"
import json
with open("request.json", encoding="utf-8") as f:
    payload = json.load(f)
response = requests.post(
    "https://www.arnproxy.com/account/api/v1/residential/lists/create",
    headers=headers, json=payload,
    timeout=(10, 30), allow_redirects=False
)
print(response.status_code, response.text)
# No automatic write retry.
```

### javascript

```javascript
const headers = { Authorization: `Bearer ${process.env.ARNPROXY_API_KEY}` };
headers['Idempotency-Key'] = 'YOUR_SAVED_OPERATION_KEY';
const { readFile } = await import('node:fs/promises');
headers['Content-Type'] = 'application/json';
const body = await readFile('request.json', 'utf8');
const response = await fetch("https://www.arnproxy.com/account/api/v1/residential/lists/create", {
  method: 'POST', headers, redirect: 'error',
  signal: AbortSignal.timeout(30000), body
});
console.log(response.status, await response.text());
// A write timeout is ambiguous; query its saved operation.
```

### php

```php
<?php
$headers = ['Accept: application/json',
    'Authorization: Bearer '.getenv('ARNPROXY_API_KEY')];
$headers[] = 'Idempotency-Key: YOUR_SAVED_OPERATION_KEY';
$headers[] = 'Content-Type: application/json';
$ch = curl_init('https://www.arnproxy.com/account/api/v1/residential/lists/create');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_FOLLOWLOCATION => false,
    CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_VERIFYHOST => 2,
    CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 30,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => file_get_contents('request.json'),
]);
$result = curl_exec($ch);
if ($result === false) {
    // Do not repeat a write; use the original operation key.
    throw new RuntimeException('Transport result unknown');
}
echo curl_getinfo($ch, CURLINFO_HTTP_CODE).PHP_EOL.$result;
curl_close($ch);
```

### go

```go
package main

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

func main() {
  client := &http.Client{Timeout: 30*time.Second,
    CheckRedirect: func(req *http.Request, via []*http.Request) error {
      return http.ErrUseLastResponse
    }}
  var body io.Reader
  file, err := os.Open("request.json"); if err != nil { panic(err) }
  defer file.Close(); body = file
  req, err := http.NewRequest("POST", "https://www.arnproxy.com/account/api/v1/residential/lists/create", body)
  if err != nil { panic(err) }
  req.Header.Set("Authorization", "Bearer "+os.Getenv("ARNPROXY_API_KEY"))
  req.Header.Set("Idempotency-Key", "YOUR_SAVED_OPERATION_KEY")
  req.Header.Set("Content-Type", "application/json")
  res, err := client.Do(req); if err != nil { panic(err) }
  defer res.Body.Close()
  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }
  fmt.Println(res.StatusCode, string(data))
}
```

### csharp

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

using var handler = new HttpClientHandler { AllowAutoRedirect = false };
using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(30) };
using var request = new HttpRequestMessage(HttpMethod.Post,
    "https://www.arnproxy.com/account/api/v1/residential/lists/create");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("ARNPROXY_API_KEY"));
request.Headers.Add("Idempotency-Key", "YOUR_SAVED_OPERATION_KEY");
request.Content = new StringContent(
    await File.ReadAllTextAsync("request.json"), Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
// Never automatically retry an ambiguous write.
```

### java

```java
import java.net.URI;
import java.net.http.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;

// Inside your application method:
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://www.arnproxy.com/account/api/v1/residential/lists/create"))
    .header("Authorization", "Bearer " + System.getenv("ARNPROXY_API_KEY"))
    .header("Accept", "application/json")
    .header("Idempotency-Key", System.getenv("ARNPROXY_OPERATION_KEY"))
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(
        Files.readString(Path.of("request.json"), StandardCharsets.UTF_8)))
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
```

## Responses · HTTP 200, 202

```json
{
  "ok": true,
  "data": {
    "state": "completed",
    "action": "create",
    "package_id": 20001,
    "list_id": 30001,
    "reason_code": null,
    "replayed": false,
    "credentials_included": false,
    "gb_purchased": 0,
    "balance_changes": 0,
    "package_expiry_changes": 0,
    "manual_review_required": false
  },
  "meta": {
    "request_id": "000000000000000000000001",
    "phase": "public_v1",
    "source": "arnproxy_records"
  }
}
```

| Name | Type | Conditional | Description |
|---|---|---|---|
| `ok` | boolean | — | Success envelope flag; on false inspect error.code. |
| `data` | object | — | Operation-specific result; examples are illustrative and synthetic. |
| `data.state` | string | — | Record/operation state. accepted is not delivery; completed is not a connection test. |
| `data.action` | string | — | Operation-specific action value; preserve its demonstrated type and consult the behavior notes. |
| `data.package_id` | integer | — | Relevant ARNPROXY record ID; use it instead of the upstream internal ID. |
| `data.list_id` | integer | — | Relevant ARNPROXY record ID; use it instead of the upstream internal ID. |
| `data.reason_code` | string|null | — | Fixed reason code or null, never raw provider error text. |
| `data.replayed` | boolean | — | Saved result for the same operation was returned, not proof of a new debit/action. |
| `data.credentials_included` | boolean | — | Whether this result/key includes or permits sensitive credentials. |
| `data.gb_purchased` | integer | — | Traffic amount; list/settings operations do not purchase traffic. |
| `data.balance_changes` | integer | — | Reported effect of this operation; an automatic-renewal setting can cause future separate debits. |
| `data.package_expiry_changes` | integer | — | Operation-specific package expiry changes value; preserve its demonstrated type and consult the behavior notes. |
| `data.manual_review_required` | boolean | — | Operation-specific manual review required value; preserve its demonstrated type and consult the behavior notes. |
| `meta` | object | — | Request correlation and data-source metadata. |
| `meta.request_id` | string | — | This HTTP request’s correlation ID, not an operation key or order ID. |
| `meta.phase` | string | — | Operation-specific phase value; preserve its demonstrated type and consult the behavior notes. |
| `meta.source` | string | — | Data source; local records and a live provider lookup are different evidence. |

## Behavior & important notes

- Package and list IDs are ARNPROXY record IDs, not upstream package keys or list IDs. A stale package snapshot cannot grant access; refresh it with residential_package_refresh when needed.
- New lists support login_password or ip_auth. IP-auth lists accept 1–20 unique public IPv4 addresses. Deleting a list does not delete its GB package; only connections using that list are revoked.
- A timeout/5xx is not proof that a write failed. Use the original Idempotency-Key with its status resource. Do not retry under a new key; GET does not resend the change.

Authentication and validation may reject a request before execution. Consult the error reference and retain request_id when contacting support. Never send keys or passwords.

[Errors & limits](https://docs.arnproxy.com/api-v1/errors)

[Follow the same operation: Verify the list operation with GETs; never resend create/delete](https://docs.arnproxy.com/api-v1/residential/lists/action-status)
