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

# Detalhar cliente

GET https://wbudget.app/api/v1/api/v1/clients/{id}

Consulta o cadastro, os contatos e o resumo comercial de um cliente.

**Autenticação:** Bearer Token da API WBudget. O acesso aos dados respeita as permissões do usuário.

### Parâmetros de caminho

| Campo | Tipo    | Obrigatório | Descrição      |
| ----- | ------- | ----------- | -------------- |
| `id`  | integer | Sim         | ID do cliente. |

### Resposta

HTTP **200**. Os exemplos usam dados fictícios e mostram os campos principais; outros campos podem acompanhar a resposta. Campos sem valor podem ser nulos.

Campos principais de `data`:

| Campo                 | Tipo            | Descrição                                      |
| --------------------- | --------------- | ---------------------------------------------- |
| `id`                  | integer         | ID do cliente.                                 |
| `name`                | string          | Nome.                                          |
| `email`               | string          | E-mail.                                        |
| `phone`               | string          | Telefone.                                      |
| `national_id`         | string          | Documento.                                     |
| `sponsor`             | string          | Contato principal.                             |
| `address`             | object          | Endereço.                                      |
| `status`              | string          | Situação do cadastro.                          |
| `metadata`            | object ou array | Valores personalizados, conforme configuração. |
| `contacts`            | array\<object>  | Contatos do cliente.                           |
| `contacts[].id`       | integer         | ID para usar em contactId.                     |
| `contacts[].name`     | string          | Nome.                                          |
| `contacts[].email`    | string          | E-mail.                                        |
| `contacts[].phone`    | string          | Telefone.                                      |
| `contacts[].position` | string          | Cargo.                                         |
| `contacts[].main`     | integer         | 1 indica contato principal.                    |
| `contacts[].active`   | integer         | 1 indica contato ativo.                        |

```json
{
  "data": {
    "id": 101,
    "name": "Empresa Exemplo",
    "sponsor": "Ana Silva",
    "email": "contato@example.com",
    "phone": "+5511999990000",
    "national_id": "11222333000181",
    "contacts": [
      {
        "id": 201,
        "name": "Ana Silva",
        "email": "ana@example.com",
        "phone": "+5511999990000",
        "position": "Compras",
        "main": 1,
        "active": 1
      }
    ],
    "budget_count": 1,
    "budget_value_total": 1500,
    "activity_count": 1
  }
}
```

### Erros específicos

| HTTP | Código             | Situação          |
| ---- | ------------------ | ----------------- |
| 404  | `CLIENT_NOT_FOUND` | Client not found. |

Consulte a introdução da collection para o formato de erros e a configuração das variáveis.

Reference: https://developers.wbudget.app/w-budget/clientes/detalhar-cliente

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required) — ID do cliente.

## Response

### 200

OK

- `data` (object, required)
  - `id` (integer, required)
  - `name` (string, required)
  - `sponsor` (string, required)
  - `email` (string, required)
  - `phone` (string, required)
  - `national_id` (string, required)
  - `contacts` (list of object, required)
    - `id` (integer, required)
    - `name` (string, required)
    - `email` (string, required)
    - `phone` (string, required)
    - `position` (string, required)
    - `main` (integer, required)
    - `active` (integer, required)
  - `budget_count` (integer, required)
  - `budget_value_total` (integer, required)
  - `activity_count` (integer, required)

## Errors

### 404 Not Found Error

Not Found

- `error` (object, required)
  - `message` (string, required)
  - `code` (string, required)

## Examples

**Response**

```json
{
  "data": {
    "id": 101,
    "name": "Empresa Exemplo",
    "sponsor": "Ana Silva",
    "email": "contato@example.com",
    "phone": "+5511999990000",
    "national_id": "11222333000181",
    "contacts": [
      {
        "id": 201,
        "name": "Ana Silva",
        "email": "ana@example.com",
        "phone": "+5511999990000",
        "position": "Compras",
        "main": 1,
        "active": 1
      }
    ],
    "budget_count": 1,
    "budget_value_total": 1500,
    "activity_count": 1
  }
}
```

**SDK Code**

```python Clientes_Detalhar cliente_example
import requests

url = "https://wbudget.app/api/v1/api/v1/clients/101"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Clientes_Detalhar cliente_example
const url = 'https://wbudget.app/api/v1/api/v1/clients/101';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Clientes_Detalhar cliente_example
package main

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

func main() {

	url := "https://wbudget.app/api/v1/api/v1/clients/101"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Clientes_Detalhar cliente_example
require 'uri'
require 'net/http'

url = URI("https://wbudget.app/api/v1/api/v1/clients/101")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Clientes_Detalhar cliente_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://wbudget.app/api/v1/api/v1/clients/101")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://wbudget.app/api/v1/api/v1/clients/101', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Clientes_Detalhar cliente_example
using RestSharp;

var client = new RestClient("https://wbudget.app/api/v1/api/v1/clients/101");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Clientes_Detalhar cliente_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://wbudget.app/api/v1/api/v1/clients/101")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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