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

# Get lost reason

> Get lost reason

Get lost reason

```http theme={null}
GET https://services.leadconnectorhq.com/opportunities/lost-reason
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Query parameters

<ParamField query="locationId" type="string" required default="ve9EPM428h8vShlRW1KT" />

<ParamField query="name" type="string" default="lost reason">
  lost reason name
</ParamField>

<ParamField query="deleted" type="boolean" default="False">
  deleted
</ParamField>

<ParamField query="query" type="string" default="dentist">
  search query
</ParamField>

<ParamField query="skip" type="number" default="1">
  skip
</ParamField>

<ParamField query="limit" type="number" default="10">
  limit
</ParamField>

<ParamField query="getCount" type="boolean" default="field">
  get count
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="lostReasons" type="object[]">
    <Expandable title="cada item">
      <ResponseField name="id" type="string" default="ve9EPM428h8vShlRW1KT">
        lost reason id
      </ResponseField>

      <ResponseField name="name" type="string" default="lost reason">
        lost reason name
      </ResponseField>

      <ResponseField name="locationId" type="string" default="location_id">
        account id
      </ResponseField>

      <ResponseField name="updatedAt" type="string" default="2023-06-19T12:04:22.488Z">
        updated at
      </ResponseField>

      <ResponseField name="createdAt" type="string" default="2023-06-19T12:04:22.488Z">
        created at
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="total" type="number" default="100" />

  ```json theme={null}
  {
    "lostReasons": [
      {
        "id": "ve9EPM428h8vShlRW1KT",
        "name": "lost reason",
        "locationId": "location_id",
        "updatedAt": "2023-06-19T12:04:22.488Z",
        "createdAt": "2023-06-19T12:04:22.488Z"
      }
    ],
    "total": 100
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/opportunities/lost-reason' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/opportunities/lost-reason', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'GET',
      'https://services.leadconnectorhq.com/opportunities/lost-reason',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/opportunities/lost-reason');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'GET',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
