Edit URLs

There are three styles to edit URLs.

First style - edit single URL.

PATCH /urls/[current_hash]

Input parameters: { "urls": [ { "custom_hash": "new_hash", "long_url": "http://example.com", "note": "new note", "email_stats": false, "expiration_date": "2016-01-02", "tags":["+new_tag","-old_tag"] } ] }

All fields are optional.

Tags field contains instructions for adding and removing tags. Tags prefixed with "+" will be attached to URL. Tags prefixed with "-" will be detached from URL.


Second style - set same properties for many URLs.

URL hashes should be listed in "hashes" parameter and separated by comma.

PATCH /urls?hashes=a%2Cb%2Cc

Input parameters: { "urls": [ { "note": "collective note" } ] }

The above call will set "note" property for URLs with hashes "a","b" and "c".


Third style - arbitrary edit many URLs

PATCH /urls

Input params: { "urls": [ { "hash": "a", "note": "polite note" }, { "hash": "b", "note": "creative note" }, { "hash": "c", "note": "boring note" } ] }

In this case "hash" field is mandatory.


Response of all three styles have the same structure. And it is similar to the structure of POST call ("page" section is not included).

It is also possible to edit many URLs using Tags. But is this case only "note", "expiration_date", "max_clicks", "email_stats", "ping", "protected", "archived" fields may be edited.

When editing with tags, no URLs returned with response.