> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gmproxys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Editar Proxy

> Atualiza um usuário da proxy existente.

Atualiza parâmetros de um usuário da proxy existente. Todos os campos, exceto `user_id`, são opcionais — envie apenas os que deseja alterar.

## Headers

<ParamField header="X-API-Key" type="string" required>
  Sua chave de API no formato `gm_SUA_CHAVE`.
</ParamField>

## Body

<ParamField body="user_id" type="string" required>
  ID do proxy (usuario) a ser atualizado.
</ParamField>

<ParamField body="threads" type="string">
  Nova quantidade de threads.
</ParamField>

<ParamField body="countries" type="string[]">
  Lista de códigos de países permitidos (ex.: `["br", "us"]`).
</ParamField>

<ParamField body="states" type="string[]">
  Lista de códigos de estados permitidos.
</ParamField>

<ParamField body="cities" type="string[]">
  Lista de códigos de cidades permitidas.
</ParamField>

<ParamField body="blocked_hosts" type="string[]">
  Lista de hosts que devem ser bloqueados (ex.: `["google.com", "youtube.com"]`).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.gmproxys.com/v1/update \
    -H "X-API-Key: gm_SUA_CHAVE" \
    -H "Content-Type: application/json" \
    -d '{
      "user_id": "5061",
      "threads": "2000",
      "countries": ["br"],
      "states": [],
      "cities": ["saopaulo", "parana"],
      "blocked_hosts": ["google.com", "youtube.com"]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.gmproxys.com/v1/update", {
    method: "POST",
    headers: {
      "X-API-Key": "gm_SUA_CHAVE",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      user_id: "5061",
      threads: "2000",
      countries: ["br"],
      states: [],
      cities: ["saopaulo", "parana"],
      blocked_hosts: ["google.com", "youtube.com"],
    }),
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.gmproxys.com/v1/update",
      headers={
          "X-API-Key": "gm_SUA_CHAVE",
          "Content-Type": "application/json",
      },
      json={
          "user_id": "5061",
          "threads": "2000",
          "countries": ["br"],
          "states": [],
          "cities": ["saopaulo", "parana"],
          "blocked_hosts": ["google.com", "youtube.com"],
      },
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": 5061,
    "login": "82364cb158467f5e5a64",
    "password": "ba4d43e7b0ee471c",
    "balance": 0,
    "balance_format": 0,
    "threads": 2000,
    "allowed_ips": [],
    "blocked": false,
    "type": "residential",
    "default_pool_parameters": {
      "countries": ["br"],
      "cities": ["saopaulo", "parana"],
      "states": [],
      "exclude_countries": []
    },
    "blocked_hosts": ["google.com", "youtube.com"]
  }
  ```

  ```json 401 Token inválido theme={null}
  {
    "success": false,
    "message": "Invalid API token."
  }
  ```

  ```json 404 Proxy inexistente theme={null}
  {
    "success": false,
    "message": "Proxy user not found."
  }
  ```
</ResponseExample>
