LinksUpdate link

Update link

Partially update a short link owned by the authenticated location. Requires an agency key (ak_). Only the fields listed in UpdateLinkRequest are accepted; unknown fields are ignored.

curl -X PATCH "https://mythic-analytics.gulp.workers.dev/client/v1/links/123e4567-e89b-12d3-a456-426614174000?location_id=example_string" \
  -H "Content-Type: application/json" \
  -H "X-Location-Id: example_string" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "slug": "example_string",
  "destination_url": "example_string",
  "title": "example_string",
  "redirect_type": 42,
  "enabled": true,
  "utm_passthrough": true,
  "metadata": {},
  "expires_at": "2024-12-25T10:00:00Z"
}'
{
  "success": true,
  "data": {
    "id": "4f9a2c1e-8b3d-4e7a-9c2f-1a2b3c4d5e6f",
    "location_id": "acme-retail",
    "slug": "summer-sale",
    "destination_url": "https://acme-retail.com/summer-sale",
    "title": "Summer Sale Campaign",
    "redirect_type": 302,
    "enabled": true,
    "utm_passthrough": true,
    "metadata": {},
    "expires_at": "2024-12-25T10:00:00Z",
    "created_at": "2024-06-01T12:00:00.000Z",
    "updated_at": "2024-06-15T08:30:00.000Z",
    "click_count": 1247
  }
}
PATCH
/links/{linkId}
PATCH
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Client API key as a bearer token. Use an agency key (ak_..., read-write) or a location secret key (sk_..., read-only). Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need links:read or links:write. See Using an mcp_ key over HTTP.

Client API key as a bearer token. Use an agency key (ak_..., read-write) or a location secret key (sk_..., read-only). Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need links:read or links:write. See Using an mcp_ key over HTTP.
path
linkIdstring
Required

Link identifier (UUID from link_redirects.id).

Format: uuid
query
location_idstring

Target location (client) id. Required when authenticating with an agency key (ak_); alternative to the X-Location-Id header. Ignored for secret keys, which resolve their own location.

Content-Typestring
Required

The media type of the request body

Options: application/json
header
X-Location-Idstring

Target location (client) id. Required when authenticating with an agency key (ak_); alternative to the location_id query parameter. Ignored for secret keys.

slugstring

New slug, 1-128 chars of [a-zA-Z0-9_-].

redirect_typeinteger
Options: 301, 302
expires_atstring
Format: date-time
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Client API key as a bearer token. Use an agency key (ak_..., read-write) or a location secret key (sk_..., read-only). Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need links:read or links:write. See Using an mcp_ key over HTTP.

Path Parameters

linkIdstring
Required

Link identifier (UUID from link_redirects.id).

Query Parameters

location_idstring

Target location (client) id. Required when authenticating with an agency key (ak_); alternative to the X-Location-Id header. Ignored for secret keys, which resolve their own location.

Headers

X-Location-Idstring

Target location (client) id. Required when authenticating with an agency key (ak_); alternative to the location_id query parameter. Ignored for secret keys.

Responses

successboolean
dataobject