# Export an existing connection list; does not create a list

`POST /account/api/v1/residential/export`

## Authorization

`Authorization: Bearer YOUR_ARNPROXY_API_KEY`

`Accept: application/json`

Required permission: `read + optional credentials`

`Content-Type: application/json`

## Parameters

| Name | Type | Required / Conditional | Default | Description |
|---|---|---|---|---|
| `list_id` (body) | integer | Required | — | Owned ARNPROXY connection-list record ID, not the supplier list ID. |
| `format` (body) | string | Optional | `"host_port"` | host_port \| host_port_user_pass \| user_pass_host_port \| uri. Credential-bearing formats need credentials permission. Also supports csv \| custom. |
| `protocol` (body) | string | Optional | `"http"` | http or socks5; controls the prefix only for uri output. |
| `offset` (body) | integer | Optional | `0` | 0–9999, below the port count. |
| `limit` (body) | integer | Optional | `100` | 1–1000; default 100. |
| `columns` (body) | string[] | Conditional | — | CSV only: id, endpoint, ip, port, login, password. Default ["id","endpoint"]. Login/password require credentials permission. |
| `template` (body) | string | Conditional | — | Required for custom, at most 200 characters. %endpoint%, %ip%, %port%, %id%, %login%, %username%, %password%, %login_url%, %password_url%. Control characters and unknown placeholders are rejected. |

## 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
{
  "list_id": "YOUR_LIST_ID",
  "format": "host_port",
  "offset": 0,
  "limit": 10
}
```

## Additional usage examples

IDs and prices are illustrative; use real values from the catalog and the same quote. JSON IDs and expected_total_minor must be numbers. Examples deliberately keep terms=false; submit terms=true only after explicit customer approval for the real paid operation.

### CSV export

Choose CSV columns from id, endpoint, ip, port, login and password. Custom formats accept only the documented %...% tokens and never execute code. Credential-bearing output requires credentials permission. The content is returned inside JSON; your application saves it to a file.

```json
{
  "list_id": 10001,
  "format": "csv",
  "columns": [
    "id",
    "endpoint"
  ],
  "protocol": "http",
  "offset": 0,
  "limit": 10
}
```

### Custom connection format

Choose CSV columns from id, endpoint, ip, port, login and password. Custom formats accept only the documented %...% tokens and never execute code. Credential-bearing output requires credentials permission. The content is returned inside JSON; your application saves it to a file.

```json
{
  "list_id": 10001,
  "format": "custom",
  "template": "http://%login_url%:%password_url%@%endpoint%",
  "protocol": "http",
  "offset": 0,
  "limit": 10
}
```

## 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 \
    --request POST --header 'Content-Type: application/json' \
    --data-binary @request.json \
    'https://www.arnproxy.com/account/api/v1/residential/export'
```

### python

```python
import os, requests

headers = {"Authorization": "Bearer " + os.environ["ARNPROXY_API_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/export",
    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}` };
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/export", {
  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[] = 'Content-Type: application/json';
$ch = curl_init('https://www.arnproxy.com/account/api/v1/residential/export');
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/export", body)
  if err != nil { panic(err) }
  req.Header.Set("Authorization", "Bearer "+os.Getenv("ARNPROXY_API_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/export");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("ARNPROXY_API_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/export"))
    .header("Authorization", "Bearer " + System.getenv("ARNPROXY_API_KEY"))
    .header("Accept", "application/json")
    .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

```json
{
  "ok": true,
  "data": {
    "list_id": 30001,
    "package_id": 20001,
    "authentication": "login_password",
    "format": "host_port",
    "protocol": null,
    "items": [
      "res.arnproxy.com:10000"
    ],
    "count": 1,
    "next_offset": 1,
    "credentials_included": false,
    "snapshot": {
      "source": "arnproxy_records",
      "observed_at": "2030-01-01T12:00:00+00:00",
      "fresh": true,
      "max_age_seconds": 3600,
      "reason": null
    },
    "source": "arnproxy_records",
    "provider_requests": 0,
    "proxy_connections_tested": false,
    "session_targeting_applied": 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.list_id` | integer | — | Relevant ARNPROXY record ID; use it instead of the upstream internal ID. |
| `data.package_id` | integer | — | Relevant ARNPROXY record ID; use it instead of the upstream internal ID. |
| `data.authentication` | string | — | Connection list authentication mode: login_password or ip_auth. |
| `data.format` | string | — | Operation-specific format value; preserve its demonstrated type and consult the behavior notes. |
| `data.protocol` | string|null | — | Operation-specific protocol value; preserve its demonstrated type and consult the behavior notes. |
| `data.items` | array | — | Records on this page or formatted connection strings; an empty list can be valid. |
| `data.items[]` | string | — | Records on this page or formatted connection strings; an empty list can be valid. |
| `data.count` | integer | — | Number of records visible in this result or generated connection strings. |
| `data.next_offset` | integer | — | Next connection-output offset, or null when complete. |
| `data.credentials_included` | boolean | — | Whether this result/key includes or permits sensitive credentials. |
| `data.snapshot` | object | — | Package snapshot origin/time/freshness; stale snapshots do not grant management access. |
| `data.snapshot.source` | string | — | Data source; local records and a live provider lookup are different evidence. |
| `data.snapshot.observed_at` | string | — | Timestamp in the API’s returned representation; example dates are synthetic. |
| `data.snapshot.fresh` | boolean | — | Whether the observation satisfies its freshness window. |
| `data.snapshot.max_age_seconds` | integer | — | Maximum snapshot age allowed for freshness, in seconds. |
| `data.snapshot.reason` | string|null | — | Fixed reason code or null, never raw provider error text. |
| `data.source` | string | — | Data source; local records and a live provider lookup are different evidence. |
| `data.provider_requests` | integer | — | Operation-specific provider requests value; preserve its demonstrated type and consult the behavior notes. |
| `data.proxy_connections_tested` | boolean | — | Operation-specific proxy connections tested value; preserve its demonstrated type and consult the behavior notes. |
| `data.session_targeting_applied` | boolean | — | Operation-specific session targeting applied 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.
- Credential-bearing output requires credentials permission. Never log or send returned connection strings, passwords or Authorization headers to support.

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)
