---
title: "Update Shortened URL"
method: PUT
path: "/tools/url/{linkId}"
tags: ["tools > url"]
---

# Update Shortened URL

`PUT /tools/url/{linkId}`

## Request

- Base URL: `https://api.pinnacle.sh`
- URL: `https://api.pinnacle.sh/tools/url/{linkId}`
- Auth: API key in header `PINNACLE-API-KEY`

Update the destination or expiration date of an existing shortened URL. Expiring links cannot be updated into a permalink.

## Path parameters

- `linkId` string, required

## Request body

- UpdateUrlSchema
  - `url` string: New destination URL where your visitors will be redirected.
  - `options` UrlOptionsSchema
    - `expiresAt` string, nullable: Expiration date in ISO 8601 format for the shortened URL. <br> If omitted, then a permalink is generated instead. Short permalinks contain a 30-digit link id. Short links with an expiration date contain a 8-digit link id.

## Response `200`

Returns the updated shortened URL and its configuration.

- PinnacleUrl
  - `url` string, required: Your custom shortened link following the format `https://pncl.to/{linkId}`, where `{linkId}` is the unique identifier for the URL that can be used with our other endpoint.
  - `config` PinnacleUrlConfig, required
    - `to` string, required: Destination URL that your shortened link redirects to.
    - `expiresAt` string, nullable, required: Expiration date for your shortened link in ISO 8601 format, or null if it's permanent.

## Other responses

- `400`: The request was unacceptable, often due to providing an invalid update. <br> Errors may originate from invalid payload or from Pinnacle's additional validation checks. For example, providing an URL that cannot be accessed, updating a campaign that is currently being reviewed, updating data that you cannot access, sending a malformed message, and so on. <br> For `Pinnacle Validation Error` inspect the `error` payload to determine the source of the failure. These errors are likely due to additional validation and business logic checks.<br> For `Request Validation Error` inspect the `description` and `errors` payload to determine the source of failure. These errors are likely due to invalid payload inside the request.
- `401`: The request lacks valid authentication credentials or the provided credentials are invalid. <br> Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint.
- `403`: Your subscription does not include access to this feature. <br> This occurs when attempting to use functionality that requires a higher subscription tier. Please upgrade your subscription to access this feature.
- `500`: An unexpected error occurred on Pinnacle's servers while processing your request. <br> If this error persists, please contact support with the request details.

---

[API](https://skmtc.dev/pinnacle/apis/pinnacle-2.md) - [All operations](https://skmtc.dev/pinnacle/apis/pinnacle-2/llms.txt) - [OpenAPI document](https://skmtc.dev/pinnacle/apis/pinnacle-2/revisions/45416dadab79?raw)
