# Renew a UHRP advertisement token (inferred)

> For the complete documentation index, see [llms.txt](https://bsvblockchain.com/docs/llms.txt).

**POST** `/renew`

Base URL: `https://{host}`

Extends the expiry of an existing advertisement UTXO by spending the
old token and creating a new one with a future expiry timestamp.  The
server charges the appropriate fee via the authenticated wallet.

## Authorization

- x-bsv-auth (apiKey in header)

## Body

Content type: `application/json`

- `uhrpUrl` (string, required)
  UHRP URL of the advertisement to renew.
- `retentionDays` (integer)
  Number of additional days to extend the advertisement.

Example:

```json
{
  "uhrpUrl": "uhrp://XYZ123abc...",
  "retentionDays": 30
}
```

## Responses

### 200

Advertisement renewed successfully.

- `uhrpUrl` (string, required)
  The UHRP URL whose advertisement was renewed.
- `expiresAt` (integer, required)
  New UNIX timestamp of the renewed advertisement UTXO expiry.
- `txid` (string, required)
  Transaction ID of the new advertisement UTXO.

Example:

```json
{
  "uhrpUrl": "uhrp://XYZ123abc...",
  "expiresAt": 1716700000,
  "txid": "b2c3d4e5..."
}
```

### 400

Bad request — invalid input.

- `error` (string, required)
  Human-readable error description.
- `code` (string)
  Machine-readable error code (see specs/errors.md).

Example:

```json
{
  "error": "invalid UHRP URL",
  "code": "ERR_INVALID_PARAMETER"
}
```

### 401

Missing or invalid BRC-103 authentication.

- `error` (string, required)
  Human-readable error description.
- `code` (string)
  Machine-readable error code (see specs/errors.md).

Example:

```json
{
  "error": "invalid UHRP URL",
  "code": "ERR_INVALID_PARAMETER"
}
```

### 404

The requested UHRP URL is not known to this server.

- `error` (string, required)
  Human-readable error description.
- `code` (string)
  Machine-readable error code (see specs/errors.md).

Example:

```json
{
  "error": "invalid UHRP URL",
  "code": "ERR_INVALID_PARAMETER"
}
```

### 500

Internal server error.

- `error` (string, required)
  Human-readable error description.
- `code` (string)
  Machine-readable error code (see specs/errors.md).

Example:

```json
{
  "error": "invalid UHRP URL",
  "code": "ERR_INVALID_PARAMETER"
}
```