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

# Opportunities Overview

> Create, list, update, delete, and manage sales pipeline opportunities and deal stages using the HoopAI Platform Opportunities REST API.

The Opportunities API provides full management of sales pipeline records in the HoopAI Platform. Use it to create and update opportunities, move deals through pipeline stages, assign monetary values, query and search opportunities by pipeline or contact, retrieve pipeline definitions and stage configurations, manage followers on opportunity records, and upsert opportunities to avoid duplicates. It is designed for integrating external CRMs, building custom sales dashboards, and automating deal progression logic.

## Base URL

```
https://services.leadconnectorhq.com
```

## Authentication

All endpoints require a Bearer token and an API version header.

```bash theme={null}
Authorization: Bearer <access_token>
Version: 2021-07-28
```

See [OAuth 2.0](/api-reference/oauth/overview) to obtain an access token.

## OAuth scopes

| Scope                    | Access                                                             |
| ------------------------ | ------------------------------------------------------------------ |
| `opportunities.readonly` | Read opportunities, pipelines, and lost reasons                    |
| `opportunities.write`    | Create, update, delete, and upsert opportunities; manage followers |

## Quick start

Create a new opportunity in a pipeline:

```bash theme={null}
curl -X POST https://services.leadconnectorhq.com/opportunities/ \
  -H "Authorization: Bearer <access_token>" \
  -H "Version: 2021-07-28" \
  -H "Content-Type: application/json" \
  -d '{
    "pipelineId": "pipeline_abc123",
    "locationId": "sadadya1u12basyhasd",
    "name": "Website Redesign Project",
    "pipelineStageId": "stage_xyz456",
    "status": "open",
    "monetaryValue": 5000,
    "contactId": "contact_abc123"
  }'
```

## Endpoints

| Method   | Path                            | Description                 |
| -------- | ------------------------------- | --------------------------- |
| `POST`   | `/opportunities/`               | Create opportunity          |
| `GET`    | `/opportunities/search`         | Search opportunity (GET)    |
| `POST`   | `/opportunities/search`         | Search opportunities (POST) |
| `POST`   | `/opportunities/upsert`         | Upsert opportunity          |
| `GET`    | `/opportunities/{id}`           | Get opportunity             |
| `PUT`    | `/opportunities/{id}`           | Update opportunity          |
| `DELETE` | `/opportunities/{id}`           | Delete opportunity          |
| `PUT`    | `/opportunities/{id}/status`    | Update opportunity status   |
| `POST`   | `/opportunities/{id}/followers` | Add followers               |
| `DELETE` | `/opportunities/{id}/followers` | Remove followers            |
| `GET`    | `/opportunities/pipelines`      | Get pipelines               |
| `GET`    | `/opportunities/lost-reason`    | Get lost reasons            |

## Related

* [Contacts API](/api-reference/contacts/overview) — Link opportunities to contact records
* [Calendars API](/api-reference/calendars/overview) — Book discovery or follow-up appointments for open deals
* [Conversations API](/api-reference/conversations/overview) — Send messages tied to opportunity workflows
