Removes a short link from the BulkGate Portal. Once deleted the link stops redirecting, including in messages that have already been sent with it.

## API URL

The URL used to send the HTTP requests:

```url
https://portal.bulkgate.com/api/1.0/shortener/remove
```

> [!NOTE]
> If the request does not reach its destination, repeat it on the [backup server](https://www.bulkgate.com/en/docs/api-administration-tokens/api-backup-server/) `backup1.bulkgate.com`.

## Supported HTTP methods

- `POST` - `application/json`

```http
POST /api/1.0/shortener/remove HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
```

> [!NOTE]
> The API has a quota of `20` requests per minute.

## Parameters table

| PARAMETER NAME    | VALUE                                                   | MANDATORY | DEFAULT VALUE |
|:------------------|:---------------------------------------------------------|:----------|:--------------|
| application_id    | [Application ID](https://www.bulkgate.com/en/docs/api-administration-tokens/api-administration/)           | **Yes**   | -             | 
| application_token | [Application authentication token](https://www.bulkgate.com/en/docs/api-administration-tokens/api-tokens/)	 | **Yes**   | -             |
| short_url         | Shortened url to be removed	                            | **Yes**   | -             |

## Request example

```http-json
POST /api/1.0/shortener/remove HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json

{
  "application_id": 451,
  "application_token": "NKN02TWE6NfBkfl-your-secret-token-Wf05GaqLIWLW4aBj",
  "short_url": "http://ur7.wf/W/1"
}
```

## Response

**In case of success:**

```json
{
    "data": {
        "short_url": "http://ur7.wf/W"
    }
}
```

**In case of error:**

```json
{
    "type": "url_not_found",
    "code": 400,
    "error": "Url not found",
    "detail": null
}
```

```json
{
    "type": "the_per_minute_quota_has_been_exceeded",
    "code": 400,
    "error": "The per minute quota has been exceeded",
    "detail": null
}
```

Where:

- **type** and **error** (description of the error) can be found in the [error types table](https://www.bulkgate.com/en/docs/api-administration-tokens/api-error-types/)
- **code** is the HTTP error code
- **detail** is additional information about the error

### Shortener API error types

Besides the [general types](https://www.bulkgate.com/en/docs/api-administration-tokens/api-error-types/), the Shortener API returns its own:

| TYPE                                    | WHEN IT HAPPENS                                                        |
|:----------------------------------------|:-----------------------------------------------------------------------|
| `url_not_found`                         | `short_url` does not exist in the account.                             |
| `the_per_minute_quota_has_been_exceeded`| The quota of 20 requests per minute is used up.                        |
