> 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 oportunidade

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

Obtém os dados de uma oportunidade.

**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 da oportunidade. |

### 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 da oportunidade.                      |
| `code`            | string  | Código comercial.                        |
| `name`            | string  | Título.                                  |
| `client`          | integer | ID do cliente.                           |
| `company`         | integer | ID da empresa emissora.                  |
| `agent`           | integer | ID do responsável.                       |
| `pipe`            | integer | ID do funil.                             |
| `status`          | integer | ID da etapa.                             |
| `state`           | string  | pending, earned ou lost.                 |
| `currency`        | string  | Moeda.                                   |
| `budget_value`    | number  | Valor comercial da proposta.             |
| `link`            | string  | Link de visualização, quando disponível. |
| `create_date`     | string  | Data de criação.                         |
| `expiration_date` | string  | Validade.                                |

```json
{
  "data": {
    "id": 1001,
    "code": "PROP-2026-001",
    "name": "Proposta de serviços",
    "client": 101,
    "client_name": "Empresa Exemplo",
    "company": 1,
    "status": 10,
    "pipe": 1,
    "state": "pending",
    "currency": "BRL",
    "budget_value": 1500,
    "create_date": "2026-09-01T10:00:00-03:00",
    "expiration_date": "2026-09-30T00:00:00-03:00"
  }
}
```

### Erros específicos

| HTTP | Código             | Situação          |
| ---- | ------------------ | ----------------- |
| 404  | `BUDGET_NOT_FOUND` | Budget 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/oportunidades/detalhar-oportunidade

## 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 da oportunidade.

## Response

### 200

OK

- `data` (object, required)
  - `id` (integer, required)
  - `code` (string, required)
  - `name` (string, required)
  - `client` (integer, required)
  - `client_name` (string, required)
  - `company` (integer, required)
  - `status` (integer, required)
  - `pipe` (integer, required)
  - `state` (string, required)
  - `currency` (string, required)
  - `budget_value` (integer, required)
  - `create_date` (datetime, required)
  - `expiration_date` (datetime, required)

## Errors

### 404 Not Found Error

Not Found

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

## Examples

**Response**

```json
{
  "data": {
    "id": 1001,
    "code": "PROP-2026-001",
    "name": "Proposta de serviços",
    "client": 101,
    "client_name": "Empresa Exemplo",
    "company": 1,
    "status": 10,
    "pipe": 1,
    "state": "pending",
    "currency": "BRL",
    "budget_value": 1500,
    "create_date": "2026-09-01T10:00:00-03:00",
    "expiration_date": "2026-09-30T00:00:00-03:00"
  }
}
```

**SDK Code**

```python Oportunidades_Detalhar oportunidade_example
import requests

url = "https://wbudget.app/api/v1/api/v1/budgets/1001"

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

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

print(response.json())
```

```javascript Oportunidades_Detalhar oportunidade_example
const url = 'https://wbudget.app/api/v1/api/v1/budgets/1001';
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 Oportunidades_Detalhar oportunidade_example
package main

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

func main() {

	url := "https://wbudget.app/api/v1/api/v1/budgets/1001"

	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 Oportunidades_Detalhar oportunidade_example
require 'uri'
require 'net/http'

url = URI("https://wbudget.app/api/v1/api/v1/budgets/1001")

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 Oportunidades_Detalhar oportunidade_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/budgets/1001")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Oportunidades_Detalhar oportunidade_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Oportunidades_Detalhar oportunidade_example
using RestSharp;

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

```swift Oportunidades_Detalhar oportunidade_example
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://wbudget.app/api/v1/api/v1/budgets/1001")! 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()
```