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

# Actualizar enlace corto

> Cambia destino o ajustes de un enlace corto.



## OpenAPI

````yaml /es/short-links-api/api-reference/openapi-short-links.json patch /v1/short-links/{id}
openapi: 3.0.3
info:
  title: 'API de notificación: enlaces cortos'
  description: >-
    API para **crear**, **enumerar**, **actualizar** y **eliminar** enlaces
    cortos del espacio de trabajo (dominio predeterminado **clicar.co** o según
    configuración), además de **análisis** (series temporales y pausas) y
    **lista de clics individuales**.


    **Autenticación:** Clave API en `Authorization: Bearer sk_live_xxxxx` o
    `x-api-key: sk_live_xxxxx`. El **espacio de trabajo** es siempre el de la
    clave (cada clave API pertenece a un espacio de trabajo); **no** envíe
    `x-workspace-id` en API v1: las solicitudes con este encabezado completado
    reciben **400** (`WORKSPACE_HEADER_NOT_ALLOWED`).


    **Ámbitos:** `short_links:read` (OBTENER) y `short_links:manage` (POST,
    PATCH, BORRAR).
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Producción
security:
  - ntfShortLinksBearerAuth: []
  - ntfShortLinksApiKeyHeader: []
tags:
  - name: Enlaces cortos
    description: CRUD, listado, análisis y eventos de clic en `/v1/short-links`.
paths:
  /v1/short-links/{id}:
    patch:
      tags:
        - Short links
      summary: Actualizar enlace corto
      description: Cambia destino o ajustes de un enlace corto.
      operationId: ntfShortLinks_patchV1ShortLinksById
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID (algunos) de su enlace.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfShortLinks_PatchRequest'
            examples:
              deactivate:
                summary: Deshabilitar redireccionamiento
                value:
                  isActive: false
              newTargetAndExpiry:
                summary: Nuevo destino y fecha de caducidad
                value:
                  targetUrl: https://loja.exemplo.com/nova-landing
                  expiresAt: '2026-06-01T00:00:00.000Z'
              clearExpiry:
                summary: Eliminar vencimiento
                value:
                  expiresAt: null
      responses:
        '200':
          description: Enlace actualizado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_DetailResponse'
              examples:
                patched:
                  value:
                    success: true
                    data:
                      id: clshort01exampleid0001
                      workspaceId: clws_example_workspace01
                      domain: clicar.co
                      code: promo24
                      targetUrl: https://loja.exemplo.com/nova-landing
                      targetUrlHash: >-
                        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                      outboundAttribution: ''
                      source: API
                      createdByUserId: null
                      expiresAt: '2026-06-01T00:00:00.000Z'
                      deletedAt: null
                      isActive: false
                      clickCount: 128
                      createdAt: '2026-04-18T14:22:00.000Z'
                      updatedAt: '2026-04-20T18:30:00.000Z'
                      shortUrl: https://clicar.co/promo24
        '400':
          description: Validación del cuerpo o `targetUrl` no válido en la normalización.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/NtfShortLinks_ErrorResponse'
                  - $ref: '#/components/schemas/NtfShortLinks_ValidationErrorResponse'
              examples:
                badTargetUrl:
                  value:
                    success: false
                    error: Bad Request
                    message: 'Invalid URL: ...'
                    code: BAD_REQUEST
        '401':
          description: Clave API faltante o no válida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_ErrorResponse'
        '403':
          description: Falta el alcance `short_links:manage`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_ErrorResponse'
        '404':
          description: El enlace no existe o ha sido eliminado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_ErrorResponse'
              examples:
                notFound:
                  value:
                    success: false
                    error: Not Found
                    message: Not Found
                    code: NOT_FOUND
components:
  schemas:
    NtfShortLinks_PatchRequest:
      type: object
      minProperties: 1
      properties:
        isActive:
          type: boolean
        targetUrl:
          type: string
          minLength: 4
          maxLength: 4096
        expiresAt:
          type: string
          nullable: true
          description: ISO 8601, `null` o cadena vacía para borrar la caducidad.
    NtfShortLinks_DetailResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/NtfShortLinks_ShortLinkFull'
    NtfShortLinks_ErrorResponse:
      type: object
      description: Error genérico de API v1 (enlaces cortos).
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: >-
            Etiqueta de error de estilo HTTP (por ejemplo, no autorizado,
            solicitud incorrecta, no encontrada).
        message:
          type: string
          nullable: true
          description: >-
            Mensaje legible por humanos para usuarios finales (localizado a
            través de Accept-Language/x-locale cuando corresponda).
        code:
          type: string
          nullable: true
          description: >-
            Código API v1 estable (enumeración). Siempre presente en los
            errores. Úselo con el estado HTTP para decidir reintentar o
            corregir. Ver [Respuestas de
            error](/es/guides/conceitos/resposta-de-erros).
      required:
        - success
        - error
        - message
        - code
    NtfShortLinks_ValidationErrorResponse:
      type: object
      description: >-
        Respuesta de validación global (Elysia) para cuerpo/consulta no válidos;
        HTTP **400**.
      required:
        - success
        - error
        - message
        - code
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Invalid data
          description: >-
            Etiqueta de error de estilo HTTP (por ejemplo, no autorizado,
            solicitud incorrecta, no encontrada).
        message:
          type: string
          description: >-
            Mensaje legible por humanos para usuarios finales (localizado a
            través de Accept-Language/x-locale cuando corresponda).
        fields:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
          description: Erros por campo (formato pode variar conforme versão do validador).
        details:
          type: object
          description: Presente solo en el entorno de desarrollo, cuando corresponda.
        code:
          type: string
          description: >-
            Código API v1 estable (enumeración). Siempre presente en los
            errores. Úselo con el estado HTTP para decidir reintentar o
            corregir. Ver [Respuestas de
            error](/es/guides/conceitos/resposta-de-erros).
    NtfShortLinks_ShortLinkFull:
      type: object
      description: Modelo persistente + `shortUrl`; fechas en ISO 8601.
      properties:
        id:
          type: string
        workspaceId:
          type: string
        domain:
          type: string
        code:
          type: string
        targetUrl:
          type: string
        targetUrlHash:
          type: string
          description: SHA-256 hexadecimal de la URL normalizada.
        outboundAttribution:
          type: string
          description: >-
            Vacío = compartido; formato `CANAL:id` enlaces clic para enviar
            (SMS, WHATSAPP,…).
        source:
          type: string
          enum:
            - AUTO
            - MANUAL
            - API
        createdByUserId:
          type: string
          nullable: true
        expiresAt:
          type: string
          nullable: true
          format: date-time
        deletedAt:
          type: string
          nullable: true
          format: date-time
        isActive:
          type: boolean
        clickCount:
          type: integer
          minimum: 0
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        shortUrl:
          type: string
          format: uri
  securitySchemes:
    ntfShortLinksBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Clave API sin autorización de encabezado. Ejemplo: `Authorization:
        Bearer sk_live_xxxxx`
    ntfShortLinksApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Clave API sin encabezado x-api-key. Ejemplo: `x-api-key: sk_live_xxxxx`'

````