---
title: "Change a share link's scope, password, or expiry"
method: PATCH
path: "/api/shares/{share_id}"
tags: ["shares"]
---

# Change a share link's scope, password, or expiry

`PATCH /api/shares/{share_id}`

## Request

- Base URL: `https://telawiki.com`
- URL: `https://telawiki.com/api/shares/{share_id}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `tela_session`

`editor+`. Sending any read-only field (`id`, `token`, `page_id`, `created_by`, `created_at`, `revoked_at`) is a 400 rather than a silent no-op. A revoked link cannot be edited — create a new one.

## Request body

- object
  - `include_descendants` boolean
  - `password` string, nullable: `null` or `""` removes the password.
  - `expires_at` string, nullable: `null` removes the expiry; a string must be a future `YYYY-MM-DD HH:MM:SS`.

## Response `200`

Updated.

- object
  - `share` ShareLink, required
    - `id` integer, required
    - `token` string, required
    - `page_id` integer, required
    - `include_descendants` boolean, required
    - `has_password` boolean, required: The password itself is never returned.
    - `created_by` integer, required
    - `created_at` string, required: `YYYY-MM-DD HH:MM:SS` in UTC.
    - `expires_at` string, nullable
    - `revoked_at` string, nullable
    - `url` string, required: The link to hand out: `<origin>/share/{token}[/{title-slug}]`.

## Other responses

- `400`: Malformed request. `code` is usually `bad_request` or `invalid_json`.
- `404`: `not_found`.
- `409`: `conflict` — the share is revoked.
- `500`: `internal` — server error.

---

[API](https://skmtc.dev/telawiki/apis/tela-rest-api.md) · [All operations](https://skmtc.dev/telawiki/apis/tela-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telawiki/apis/tela-rest-api/revisions/f316f31f6fcb?raw)
