Skip to Content

Rename a share link

Changes the slug. The old link immediately stops working, with no redirect. Request: PATCH /v1/template-projects/{projectId}/share-link.

PATCH
/v1/template-projects/{projectId}/share-link

Changes the slug. The old link immediately stops working, with no redirect.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

projectId*string
Match^tproj_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
slug*string
Match^[a-z0-9-]{3,60}$

Response Body

Success

application/json
  1. response
slug*string
Match^[a-z0-9-]{3,60}$
url*string
canonicalPath*string
views*integer
Range-9007199254740991 <= value <= 9007199254740991
opens*integer
Range-9007199254740991 <= value <= 9007199254740991
updatedAt*string
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.templateShareLinks.rename({
  "projectId": "example",
  "slug": "example"
});
Example Response
{
  "slug": "string",
  "url": "string",
  "canonicalPath": "string",
  "views": -9007199254740991,
  "opens": -9007199254740991,
  "updatedAt": "string"
}

Related documentation