> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shortmenu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update link

> Updates an existing Short Link.



## OpenAPI

````yaml put /links/{id}
openapi: 3.0.0
info:
  title: Short Menu API
  description: ''
  version: 0.0.2
  contact: {}
servers:
  - url: https://api.shortmenu.com
    description: Default
security:
  - ApiKeyAuth: []
tags: []
paths:
  /links/{id}:
    put:
      description: Updates an existing Short Link.
      operationId: updateLink
      parameters:
        - name: id
          description: >-
            The identifier of the link to update. This is the `id` field of the
            link object.
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditLinkDTO'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkDTO'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDTO'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDTO'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDTO'
components:
  schemas:
    EditLinkDTO:
      type: object
      properties:
        destinationUrl:
          type: string
          description: >-
            Updated destination URL of the short link. If not provided, the
            existing destination URL will be kept.
        tags:
          type: array
          description: >-
            Updated tags to assign to the short link. If not provided, the
            existing tags will be kept.
          items:
            $ref: '#/components/schemas/TagDTO'
    LinkDTO:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the short link.
        createdAt:
          format: date-time
          type: string
          description: Reference date and time when the short link was created.
        destinationUrl:
          type: string
          description: Destination URL of the short link.
        title:
          type: string
          description: Title of the destination URL (website), if available.
        slug:
          type: string
          description: Slug of the short link, e.g. `ios`.
        domain:
          $ref: '#/components/schemas/DomainDTO'
        shortUrl:
          type: string
          description: Full short URL of the short link, e.g. `https://shm.to/ios`.
        clickCount:
          type: number
          description: Number of times the short link has been clicked.
        tags:
          type: array
          description: Zero or more tags assigned to the short link.
          items:
            $ref: '#/components/schemas/TagDTO'
      required:
        - id
        - createdAt
        - destinationUrl
        - slug
        - domain
        - shortUrl
        - tags
    ErrorResponseDTO:
      type: object
      properties:
        code:
          enum:
            - LINK_LIMIT_REACHED
          type: string
        errorDescription:
          type: string
      required:
        - errorDescription
    TagDTO:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - name
    DomainDTO:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the domain.
        name:
          type: string
          description: Name of the domain, e.g. `shm.to`.
      required:
        - id
        - name
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Short Menu API Key. Create one at
        [shm.to/create-api-key](https://shm.to/create-api-key).

````