Link shortener

Update a link

Update the destination, code, title, or description of an existing link.

PATCHhttps://pqno.app/admin/api/encurtar-link/editarlink

Updates the link identified by the id query parameter. Use HTTP PATCH and send a JSON object containing at least one of url, codigo, titulo, descricao, expira_em, max_cliques, senha, etiquetas, or pixels.

Send only the fields to update

Omitted fields retain their values. Send an empty string to clear the title or description. Field types, lengths, and destination and code rules are the same as in Create a link.

Change the destination

Updating url preserves the short URL and redirects it to the new destination. This lets you update the destination of a QR code that contains that short URL. The new destination is scheduled for an availability check.

Change the code

Updating codigo changes the short URL. The previous URL keeps opening the same link, including from QR codes and printed materials, and stays reserved for whoever used it. Each link keeps up to 20 previous URLs, and past that the oldest stops opening. A code that is already in use or reserved returns HTTP 409; sending the current code preserves the URL.

Change the access rules

expira_em, max_cliques, and senha follow the formats in Create a link. Omitting a field keeps its current value, and null removes the rule. A new password replaces the previous one.

Changing max_cliques resets the count, and repeating the value keeps it. Sending an expira_em in the past returns HTTP 400, unless it repeats the date the link already has.

Change the tags

Sending etiquetas replaces the link's whole list. An empty list or null removes all of them. Omitting the field keeps the current ones.

Updating pixels

Sending pixels changes only the specified services. An ID replaces the current one, null removes the service and omitted services stay as they are. "pixels": null removes all services. Removal is always allowed, even after losing the required plan or installation permission.

Access and response

A personal token can update its issuer's links. A company token can update links created by anyone in that company. The original creator in criado_por is preserved.

HTTP 200 returns the updated link in dados, using the fields described in Create a link. A link that does not exist or is outside the token's scope returns 404.

Parameters

Header

Authorizationstringrequired
Send Bearer followed by your API token, for example Authorization: Bearer YOUR_TOKEN.
Content-Typestringrequired
Use application/json to send a JSON request body.

Query parameters

idintegerrequired
Link ID returned when creating or listing links.

Body (JSON)

urlstring
HTTP or HTTPS destination URL, up to 2,048 characters.
codigostring
Custom code of 3 to 50 characters. Use lowercase letters, numbers, hyphens, or underscores; start and end with a letter or number.
titulostring
Link title, up to 255 characters.
descricaostring
Link description, up to 500 characters.
expira_emstring
New expiration date and time, in the Create link format. null removes the expiration.
max_cliquesinteger
New click limit. null removes the limit. Changing the value resets the click count.
senhastring
New password of 4 to 64 characters. null removes the password.
etiquetasarray
Replaces the link's tags. An empty list or null removes all tags.
pixelsobject
Changes only the specified services: an ID replaces the current one and null removes the service. null on the field removes all of them. Removal is always allowed.