---
title: "Change when a share link stops working"
method: PATCH
path: "/v1/assets/{asset_id}/share-links/{link_id}"
tags: ["assets"]
---

# Change when a share link stops working

`PATCH /v1/assets/{asset_id}/share-links/{link_id}`

## Request

- Base URL: `https://api.patricia.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.patricia.app/v1/assets/{asset_id}/share-links/{link_id}`
- Auth: HTTP bearer

Set a working link's expiry, counted from now rather than added to what is left, or send `expires_in_days: null` to take its end date away so it works until somebody turns it off. Only a link that still works can be changed: a revoked or already-expired one is refused, because its URL has been out of use and handing that same URL back is not an edit to a date. Share the file again with a new link instead. The file's LEVEL is never a refusal on its own: a date is not an audience, and a link on a `private` file is that file's address like any other. Prolonging a publication is publishing, so this needs the same authority as deciding who may read the file: the person who added it or a workspace admin. The one exception is a file already at 'Anyone with the link', whose audience is already decided and whose links any editor may keep working. That authority is answered before the link is looked up: 403 when you may read the file but may not decide its audience, whatever link id you name, and otherwise 404 when the file or the link does not exist, has been deleted, or belongs to another workspace.

## Path parameters

- `asset_id` string, uuid, required: The asset's id.
- `link_id` string, uuid, required: The share link's id.

## Headers

- `X-Tenant-Id` string, nullable

## Request body

- AssetShareLinkExtend: A new deadline for a link that still works, counted from now rather than added to the old one — "another 30 days" is a promise a person can check on a calendar. Unlike the create body this field is REQUIRED, so ``null`` here can only ever be a deliberate "take the end date off"; there is no omission that could be read as one.
  - `expires_in_days` integer, nullable, required: How many days from now the link should keep working. Send null to take its end date away, so it works until somebody turns it off.

## Response `200`

Successful Response

- AssetShareLinkInfo: One share link as the management view lists it — no token, ever. The token is shown exactly once, on creation; the server keeps only its hash, so this shape CANNOT carry it. A link works while BOTH dates say so: ``revoked_at`` null (nobody shut it off) and ``expires_at`` still ahead (it has not run out). The two are reported separately rather than collapsed into one "active" boolean because the screen has to say WHICH happened — a revoked link was a decision, an expired one just ran out, and only one of them is worth explaining as an accident.
  - `password_protected` boolean, required
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `revoked_at` string, date-time, nullable: When this link was shut off, or null while it still works.
  - `expires_at` string, date-time, nullable: When this link stops working on its own. Null means it never does: either somebody created it with no end date, or it predates expiry entirely. Such a link is still revoked the moment somebody turns it off, deletes the file, or sets the file to 'Only me' — and a revoked link never comes back.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden. Inspect response body `code` for the specific reason (for example: PERMISSION_DENIED, EMAIL_NOT_VERIFIED, TENANT_ACCESS_REQUIRED, ROLE_UNRESOLVED)
- `409`: Conflict
- `422`: Validation error

---

[API](https://skmtc.dev/patricia/apis/patricia-api.md) · [All operations](https://skmtc.dev/patricia/apis/patricia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/patricia/apis/patricia-api/revisions/0dfb44495ea1?raw)
