---
title: "Update a link you own"
method: PATCH
path: "/v1/links/{id}"
tags: ["Links"]
---

# Update a link you own

`PATCH /v1/links/{id}`

## Request

- Base URL: `https://xn--s7y.xn--3ds443g`
- URL: `https://xn--s7y.xn--3ds443g/v1/links/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `duan_session`

Update destination on an owned link. API key scope `links:update`, or a session cookie. An OAuth access token is not accepted on this route. Other users' / unowned → **404**.

## Path parameters

- `id` string, required

## Request body

- UpdateLinkRequest: At least one of destination or title.
  - `destination` string, uri: Absolute http or https URL for create, batch, and PATCH destinations. Scheme is lowercase http:// or https:// with no surrounding whitespace.
  - `title` string

## Response `200`

Updated link

- union: Active links include destination. Other states omit it.
  - LinkStatusActive
    - `id` string, required
    - `state` 'active', required
    - `created_at` string, date-time, required
    - `status_url` string, uri, required
    - `short_url` string, uri, required
    - `short_url_ascii` string, uri, required
    - `destination` string, uri, required: Absolute http or https URL for create, batch, and PATCH destinations. Scheme is lowercase http:// or https:// with no surrounding whitespace.
    - `request_id` string, required: Same value as the X-Request-Id response header: the inbound X-Request-Id if it matches [A-Za-z0-9._-]{1,128}, otherwise a fresh server-generated id.
  - LinkStatusNonActive
    - `id` string, required
    - `state` 'quarantined' | 'disabled' | 'blocked' | 'expired', required
    - `created_at` string, date-time, required
    - `status_url` string, uri, required
    - `expired_at` string, date-time
    - `type` string, uri
    - `title` string
    - `code` string
    - `request_id` string, required: Same value as the X-Request-Id response header: the inbound X-Request-Id if it matches [A-Za-z0-9._-]{1,128}, otherwise a fresh server-generated id.

## Other responses

- `401`: AUTH_REQUIRED
- `403`: INSUFFICIENT_SCOPE, or the link is quarantined, disabled, blocked, or expired
- `404`: Unknown or non-owned link

---

[API](https://skmtc.dev/xn--s7y/apis/agent-api.md) · [All operations](https://skmtc.dev/xn--s7y/apis/agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/xn--s7y/apis/agent-api/revisions/d902f68518e9?raw)
