> For a complete page index, fetch https://developer.close.com/llms.txt

# Retrieve an opportunity

GET https://api.close.com/api/v1/opportunity/{id}/

Reference: https://developer.close.com/api/resources/opportunities/get

## Authentication

- `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty.
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required)

### Query parameters

- `_fields` (string, optional) — Comma-separated list of fields to include in the response.

## Response

### 200

Successful response

- `annualized_expected_value` (integer, required, nullable) — Annualized expected value in cents.
- `annualized_value` (integer, required, nullable) — Annualized value in cents.
- `confidence` (integer, required)
- `contact_id` (string, required, nullable)
- `created_by` (string, required, nullable)
- `date_created` (datetime, required)
- `date_lost` (datetime, required, nullable)
- `date_updated` (datetime, required)
- `date_won` (date, required, nullable)
- `expected_value` (integer, required, nullable) — Value multiplied by confidence, in cents.
- `id` (string, required)
- `lead_id` (string, required)
- `note` (string, required, nullable)
- `note_html` (string, required, nullable)
- `organization_id` (string, required)
- `status_id` (string, required)
- `updated_by` (string, required, nullable)
- `user_id` (string, required)
- `value` (integer, required, nullable) — Monetary value of the opportunity in cents, e.g. `340000` for $3,400.00. See `value_formatted` for a human-readable version.
- `value_period` (enum, required)
  - Allowed values: `one_time`, `monthly`, `annual`
- `attachments` (list of Attachment, optional)
- `comment_summary` (CommentSummary, optional, nullable)
- `contact_name` (string, optional, nullable)
- `created_by_name` (string, optional, nullable)
- `integration_links` (list of RenderedIntegrationLink, optional)
- `is_stalled` (boolean, optional)
- `lead_name` (string, optional, nullable)
- `lead_primary_email` (ContactEmail, optional, nullable)
- `lead_primary_phone` (list of ContactPhone, optional, nullable)
- `pipeline_id` (string, optional, nullable)
- `pipeline_name` (string, optional, nullable)
- `stall_status` (StalledOpportunityActionItems, optional, nullable)
- `status_display_name` (string, optional)
- `status_label` (string, optional)
- `status_type` (enum, optional)
  - Allowed values: `won`, `lost`, `active`
- `suggested_action` (OpportunitySuggestedAction, optional, nullable)
- `updated_by_name` (string, optional, nullable)
- `user_name` (string, optional, nullable)
- `value_currency` (string, optional, nullable)
- `value_formatted` (string, optional, nullable)

## Errors

### 400 Bad Request Error

Bad request

- `any`

### 401 Unauthorized Error

Unauthorized

- `any`

### 404 Not Found Error

Not found

- `any`

## Types

### Attachment

- `content_type` (string, required, nullable)
- `filename` (string, required, nullable)
- `size` (integer, required, nullable)
- `url` (string, required)
- `thumbnail_url` (string, optional, nullable)

### CommentSummary

- `comment_count` (integer, required)
- `thread_id` (string, required)

### RenderedIntegrationLink

- `name` (string, required)
- `url` (string, required)

### ContactEmail

- `email` (string, required)
- `is_unsubscribed` (boolean, required)
- `type` (string, required)

### ContactPhone

- `phone` (string, required)
- `type` (string, required)
- `country` (string, optional, nullable)
- `outbound_sms_blocked` (boolean, optional)
- `phone_formatted` (string, optional)
- `tz_ids` (list of string, optional)

### StalledOpportunityActionItems

- `communication_issue` (enum, required) — The communication issue that is causing the stalled opportunity. If there is no issue, set to NoIssue.
  - Allowed values: `no_issue`, `cant_get_in_touch`, `no_communication_attempts`
- `next_action` (ActionItem, required, deprecated) — An action item recommended to progress or resolve the stalled opportunity.

### OpportunitySuggestedAction

- `action` (enum, required)
  - Allowed values: `change_status`, `adjust_close_date`, `follow_up_email`, `follow_up_call`, `follow_up_sms`
- `details` (OpportunitySuggestedActionDetails, required, nullable)
- `justification` (string, required)

### ActionItem

- `action` (enum, required) — The recommended next step to progress or resolve the stalled opportunity
  - Allowed values: `mark_as_lost`, `change_status`, `follow_up`, `adjust_close_date`, `ask_someone_else_to_reach_out`, `change_communication_method`
- `justification` (string, required) — A short justification for the recommended action in the sales pipeline. Maximum 2 sentences.

### OpportunitySuggestedActionDetails

- OpportunityChangeStatusActionDetails: OpportunityChangeStatusActionDetails
- OpportunityFollowUpEmailActionDetails: OpportunityFollowUpEmailActionDetails
- OpportunityFollowUpSMSActionDetails: OpportunityFollowUpSMSActionDetails
- OpportunityFollowUpCallActionDetails: OpportunityFollowUpCallActionDetails
- OpportunityAdjustCloseDateActionDetails: OpportunityAdjustCloseDateActionDetails

### OpportunityChangeStatusActionDetails

- `status_id` (string, required)

### OpportunityFollowUpEmailActionDetails

- `contact_id` (string, required)
- `message_draft` (string, required)
- `subject_draft` (string, required)

### OpportunityFollowUpSMSActionDetails

- `contact_id` (string, required)
- `message_draft` (string, required)

### OpportunityFollowUpCallActionDetails

- `call_plan` (string, required)
- `contact_id` (string, required)

### OpportunityAdjustCloseDateActionDetails

- `close_date` (date, required)

## Examples

**Response**

```json
{
  "annualized_expected_value": 37500,
  "annualized_value": 50000,
  "confidence": 75,
  "contact_id": null,
  "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "date_created": "2013-02-01T00:54:51.337000+00:00",
  "date_lost": null,
  "date_updated": "2013-02-01T00:54:51.337000+00:00",
  "date_won": null,
  "expected_value": 37500,
  "id": "oppo_8eB77gAdf8FMy6GsNHEy84f7uoeEWv55slvUjKQZpJt",
  "lead_id": "lead_IIDHIStmFcFQZZP0BRe99V1MCoXWz2PGCm6EDmR9v2O",
  "note": "Bruce needs new software for the Bat Cave.",
  "note_html": "<body><p>Bruce needs new software for the Bat Cave.</p></body>",
  "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
  "status_id": "stat_4ZdiZqcSIkoGVnNOyxiEY58eTGQmFNG3LPlEVQ4V7Nk",
  "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
  "value": 50000,
  "value_period": "one_time",
  "lead_name": "Wayne Enterprises (Sample Lead)",
  "pipeline_id": "pipe_04fC628PVB0HjK2Qq5EqEf",
  "pipeline_name": "Sales",
  "status_label": "Active",
  "status_type": "active",
  "user_name": "John Doe",
  "value_currency": "USD",
  "value_formatted": "$500",
  "custom.cf_j0P7kHmgFTZZnYBFtyPSZ3uQw4dpW8xKcW7Krps8atj": "https://www.example.com/contract.pdf"
}
```

**SDK Code**

```python opportunities_get_example
import requests

url = "https://api.close.com/api/v1/opportunity/id/"

response = requests.get(url, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript opportunities_get_example
const url = 'https://api.close.com/api/v1/opportunity/id/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

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

```go opportunities_get_example
package main

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

func main() {

	url := "https://api.close.com/api/v1/opportunity/id/"

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

	req.SetBasicAuth("<CLOSE_API_KEY>", "")

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

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

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

}
```

```ruby opportunities_get_example
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/opportunity/id/")

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

request = Net::HTTP::Get.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")

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

```java opportunities_get_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.close.com/api/v1/opportunity/id/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.close.com/api/v1/opportunity/id/', [
  'headers' => [
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

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

```csharp opportunities_get_example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/opportunity/id/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```