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

# Update a link

> Updates link data. Only provided fields are updated.



## OpenAPI

````yaml patch /public/updatelink
openapi: 3.1.0
info:
  title: Joylink API
  version: 1.0.0
  description: API for managing Joylink short links and tracking
servers:
  - url: https://api.joylink.io
    description: Production server
security: []
paths:
  /public/updatelink:
    patch:
      summary: Update a link
      description: Updates link data. Only provided fields are updated.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                  description: The key of the link to update
                new_key:
                  type: string
                  description: New key for the link
                description:
                  type: string
                  description: Link description
                destination:
                  type: string
                  description: Destination URL
                imageUrl:
                  type: string
                  description: Image URL
                productTitle:
                  type: string
                  description: Product title
              required:
                - key
      responses:
        '200':
          description: Successfully updated link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Link not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict (new key is already taken)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Link:
      type: object
      properties:
        key:
          type: string
          description: Unique identifier for the link
        description:
          type: string
          description: Description of the link
        destination:
          type: string
          description: The target URL
        imageUrl:
          type: string
          description: URL of the product image
        productTitle:
          type: string
          description: Title of the product
        userId:
          type: string
          description: ID of the user who created the link
        linkPrefix:
          type: string
          description: Custom link prefix for the user
        createdAt:
          type: string
          description: Timestamp of when the link was created
    Error:
      type: object
      properties:
        error:
          type: string
        details:
          type: string
  responses:
    RateLimitExceeded:
      description: >-
        Rate limit exceeded. Public API keys are limited to 60 requests per
        minute and 1440 requests per day, shared across endpoints.
      headers:
        X-RateLimit-Limit-Minute:
          description: Maximum requests allowed per minute.
          schema:
            type: integer
            example: 60
        X-RateLimit-Remaining-Minute:
          description: Requests remaining in the current minute window.
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset-Minute:
          description: Seconds until the minute window resets.
          schema:
            type: integer
            example: 45
        X-RateLimit-Limit-Day:
          description: Maximum requests allowed per day.
          schema:
            type: integer
            example: 1440
        X-RateLimit-Remaining-Day:
          description: Requests remaining in the current day window.
          schema:
            type: integer
            example: 1200
        X-RateLimit-Reset-Day:
          description: Seconds until the day window resets.
          schema:
            type: integer
            example: 43200
        Retry-After:
          description: >-
            Seconds to wait before retrying. Matches the limit you hit (minute
            or day).
          schema:
            type: integer
            example: 45
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            minute_limit:
              summary: Per-minute limit exceeded
              value:
                error: >-
                  Rate limit exceeded. Maximum 60 requests per minute. Resets in
                  45s.
            day_limit:
              summary: Per-day limit exceeded
              value:
                error: >-
                  Rate limit exceeded. Maximum 1440 requests per day. Resets in
                  5h 20m.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````