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

# Delete A Listing

> This endpoint delets a listing with the provided ID.

Allows for a listing to be immediately deleted or to be scheduled for deletion.

All date fields included in the body parameters need to be specified as [ISO8601-formatted date strings](https://en.wikipedia.org/wiki/ISO_8601).

Date fields should follow a "YYYY-MM-DD" format.

### Header

<ParamField header="Authorization" type="string" default="none" required>
  The authentication token for your request
</ParamField>

### Path

<ParamField path="listing_id" type="string" default="none" required>
  The id of the listing to be deleted
</ParamField>

### Body

<ParamField body="inactive-date" type="date" default="Current date" required>
  The date at which the listing should be deleted.

  If left empty, it defaults to the current date
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the listing has been succesfully scheduled for deletion or not.
</ResponseField>

<ResponseField name="listing_id" type="boolean">
  The id of the listing scheduled for deletion.
</ResponseField>

### Errors

Listed below are common errors that may be returned by the endpoint, along with their corresponding status code.

Status Code - 400

```json Missing Authorization header theme={null}
{
   "error": {
    "type": "missing_authorization",
    "message": "Your request does not include an 'Authorization' header with a bearer token for your account."
  }
}
```

Status Code - 401

```json Expired Authorization header bearer token value theme={null}
{
   "error": {
    "type": "expired_token",
    "message": "The bearer token you have provided in the 'Authorization' header has expired. Please obtain a new one."
  }
}
```

Status Code - 401

```json Invalid Authorization header bearer token value theme={null}
{
   "error": {
    "type": "invalid_authorization",
    "message": "The bearer token you have provided in the 'Authorization' header is invalid."
  }
}
```

Status Code - 401

Returned if the currently authenticated user does not have permission to delete the listing they are attempting to delete

```json Invalid/Expired Authorization header bearer token value theme={null}
{
   "error": {
    "type": "not_authorized",
    "message": "The user you have authenticated as is not authorized to delete the listing you are attempting to delete."
  }
}
```

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request "DELETE 'https://api.travtus.com/listings/listing-id-1/'" \
  --header 'Content-Type: application/json' \
  --header 'Authorization: bearer <token>' \
  --data-raw '{
    "inactive_date": "2012-01-23"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "listing_id": "listing-id-1"
  }
  ```
</ResponseExample>
