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

# Rename a journey, switch it on or off, or replace its moments

> Replacing the moments mints a new version. The enrollments already running keep executing the version they started with.



## OpenAPI

````yaml /openapi-v1.json patch /v1/journeys/{id}
openapi: 3.0.0
info:
  title: Woku Client API v1
  description: >-
    Public REST API for programmatic management of woku Voice-of-Customer
    programs: trackers, VoC instruments (NPS, woku, CES, CSAT), action plans,
    support tickets, multi-channel sending and response capture. Requests are
    company-scoped by the API key; never send a company id.
  version: 1.0.0
  contact:
    name: Woku
    url: https://woku.app
    email: team@woku.app
servers:
  - url: https://clientapi.woku.app
    description: Production
security: []
tags: []
paths:
  /v1/journeys/{id}:
    patch:
      tags:
        - v1 - journeys
      summary: Rename a journey, switch it on or off, or replace its moments
      description: >-
        Replacing the moments mints a new version. The enrollments already
        running keep executing the version they started with.
      operationId: V1JourneysController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
            format: ObjectId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1UpdateJourneyBodyDto'
      responses:
        '200':
          description: Journey updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1JourneyResponseDto'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponseDto'
        '403':
          description: Invalid API key, company access or entitlement
        '404':
          description: Journey not found
        '409':
          description: Journey key conflict
      security:
        - bearer: []
components:
  schemas:
    V1UpdateJourneyBodyDto:
      type: object
      properties:
        authHeader:
          type: string
          deprecated: true
          writeOnly: true
          description: >-
            Legacy body API key. Prefer Authorization: Bearer. Consumed by
            authentication and never forwarded to journey commands.
        authoringVersion:
          type: number
          enum:
            - 1
            - 2
          description: >-
            Use 2 for the business-form contract. Existing v1 definitions keep
            their execution rules.
        startMode:
          type: string
          enum:
            - operator
            - response
            - webhook
          description: >-
            Who starts the first moment. Response means a saved first answer,
            not opening its link.
        recipients:
          $ref: '#/components/schemas/JourneyRecipientsDto'
        name:
          type: string
          example: Viaje de ventas
        enabled:
          type: boolean
        moments:
          type: array
          items:
            $ref: '#/components/schemas/V1JourneyMomentDto'
    V1JourneyResponseDto:
      type: object
      properties:
        id:
          type: string
        key:
          type: string
        name:
          type: string
        enabled:
          type: boolean
        version:
          type: number
        authoringVersion:
          type: number
          enum:
            - 1
            - 2
        startMode:
          type: string
          enum:
            - operator
            - response
            - webhook
        recipients:
          $ref: '#/components/schemas/JourneyRecipientsDto'
        routing:
          $ref: '#/components/schemas/V1JourneyRoutingDto'
        moments:
          type: array
          items:
            $ref: '#/components/schemas/V1JourneyMomentReadDto'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - enabled
        - version
        - moments
    ValidationErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
        message:
          description: Array of validation error messages
          example:
            - email must be a valid email
            - password must be at least 8 characters
          type: array
          items:
            type: string
        error:
          type: string
          description: Error type
          example: Bad Request
      required:
        - statusCode
        - message
        - error
    JourneyRecipientsDto:
      type: object
      properties:
        ticketsEnabled:
          type: boolean
          description: Omit to keep ticket creation enabled.
        plansEnabled:
          type: boolean
          description: Omit to keep plan creation enabled.
        ticketEmails:
          description: Ticket email recipients, including the creator by default.
          type: array
          items:
            type: string
        planMembers:
          description: Platform users who belong to the journey action-plan group.
          type: array
          items:
            $ref: '#/components/schemas/JourneyPlanMemberDto'
      required:
        - ticketEmails
        - planMembers
    V1JourneyMomentDto:
      type: object
      properties:
        key:
          type: string
          pattern: ^[A-Za-z0-9_-]{1,64}$
        name:
          type: string
          maxLength: 80
        description:
          type: string
          maxLength: 280
        order:
          type: number
          description: Display order. Execution follows the trigger graph.
        tool:
          type: string
          enum:
            - woku
            - csat
            - ces
            - nps
        toolScope:
          type: string
          enum:
            - shared
            - per_enrollment
          description: >-
            V2 defaults to shared within this moment. Dynamic webhook content
            requires per_enrollment.
        toolSpec:
          $ref: '#/components/schemas/V1JourneyToolSpecDto'
        enabled:
          type: boolean
        trigger:
          $ref: '#/components/schemas/V1JourneyTriggerDto'
        webhook:
          $ref: '#/components/schemas/V1JourneyWebhookDto'
        channel:
          type: string
          enum:
            - email
            - whatsapp_first
        sequence:
          $ref: '#/components/schemas/V1JourneySequenceDto'
        presentation:
          $ref: '#/components/schemas/V1JourneyPresentationDto'
        fallbackAfterMs:
          type: number
          minimum: 1
          description: Secondary wait for a webhook-primary moment.
        fallbackFromStage:
          type: string
          description: Key of the enabled moment that arms the secondary wait.
      required:
        - key
        - tool
        - enabled
        - trigger
        - channel
        - sequence
    V1JourneyRoutingDto:
      type: object
      properties:
        ticketsReady:
          type: boolean
        plansReady:
          type: boolean
        ticketDestinationId:
          type: string
        actionPlanGroupId:
          type: string
      required:
        - ticketsReady
        - plansReady
    V1JourneyMomentReadDto:
      type: object
      properties:
        key:
          type: string
          pattern: ^[A-Za-z0-9_-]{1,64}$
        name:
          type: string
          maxLength: 80
        description:
          type: string
          maxLength: 280
        order:
          type: number
          description: Display order. Execution follows the trigger graph.
        tool:
          type: string
          enum:
            - woku
            - csat
            - ces
            - nps
        toolScope:
          type: string
          enum:
            - shared
            - per_enrollment
          description: >-
            V2 defaults to shared within this moment. Dynamic webhook content
            requires per_enrollment.
        toolSpec:
          $ref: '#/components/schemas/V1JourneyToolSpecDto'
        enabled:
          type: boolean
        trigger:
          $ref: '#/components/schemas/V1JourneyTriggerDto'
        webhook:
          $ref: '#/components/schemas/V1JourneyWebhookDto'
        channel:
          type: string
          enum:
            - email
            - whatsapp_first
        sequence:
          $ref: '#/components/schemas/V1JourneySequenceDto'
        presentation:
          $ref: '#/components/schemas/V1JourneyPresentationDto'
        fallbackAfterMs:
          type: number
          minimum: 1
          description: Secondary wait for a webhook-primary moment.
        fallbackFromStage:
          type: string
          description: Key of the enabled moment that arms the secondary wait.
        toolRef:
          readOnly: true
          description: >-
            Legacy snapshots only. New assignments of existing tools are
            rejected.
          allOf:
            - $ref: '#/components/schemas/V1JourneyLegacyToolRefDto'
      required:
        - key
        - tool
        - enabled
        - trigger
        - channel
        - sequence
    JourneyPlanMemberDto:
      type: object
      properties:
        userId:
          type: string
          description: Company member user id.
        role:
          type: string
          enum:
            - admin
            - assignee
      required:
        - userId
        - role
    V1JourneyToolSpecDto:
      type: object
      properties:
        fileId:
          type: string
          description: Woku uploaded public media ID belonging to this company.
        imageUrl:
          type: string
          description: >-
            Derived media URL. Saving with fileId resolves its authoritative
            URL.
        descriptionEn:
          type: string
          minLength: 3
          maxLength: 140
        subject:
          description: >-
            Variable in the fixed CSAT, CES or NPS question, not the complete
            question.
          allOf:
            - $ref: '#/components/schemas/V1JourneyLocaleDto'
        audience:
          description: NPS recommendation audience.
          allOf:
            - $ref: '#/components/schemas/V1JourneyLocaleDto'
    V1JourneyTriggerDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - manual
            - event
            - webhook
            - afterStage
        event:
          type: string
          description: >-
            Legacy event trigger name. Reserved journey events cannot be
            emitted.
        stage:
          type: string
          description: 'afterStage: key of the earlier moment.'
        anchor:
          type: string
          enum:
            - sent
            - response
            - event
        delayMs:
          type: number
          minimum: 0
          description: afterStage wait in milliseconds. A v2 zero delay means one hour.
        window:
          $ref: '#/components/schemas/V1JourneySendWindowDto'
        verification:
          description: Legacy webhook verification; use webhook.verification in v2.
          allOf:
            - $ref: '#/components/schemas/V1JourneyVerificationDto'
        payload:
          description: Legacy webhook mapping; use webhook.payload in v2.
          allOf:
            - $ref: '#/components/schemas/V1JourneyPayloadMapDto'
      required:
        - type
    V1JourneyWebhookDto:
      type: object
      properties:
        verification:
          $ref: '#/components/schemas/V1JourneyVerificationDto'
        payload:
          $ref: '#/components/schemas/V1JourneyPayloadMapDto'
        contentMode:
          type: string
          enum:
            - manual
            - webhook
          description: >-
            Content source, independent from trigger. Webhook content requires
            per_enrollment scope.
        schema:
          type: object
          additionalProperties: true
          description: >-
            Bounded JSON Schema: object root, at most 20000 characters, depth 8,
            200 nodes and 50 properties per node. Supports type, properties,
            required, additionalProperties, items, enum, minLength, maxLength,
            minimum, maximum, minItems, maxItems, title and description. No
            references or regex.
        content:
          $ref: '#/components/schemas/V1JourneyWebhookContentDto'
    V1JourneySequenceDto:
      type: object
      properties:
        attemptOffsetsMs:
          description: >-
            Initial invitation and reminder offsets from activation. [0,
            86400000] sends one reminder the next day.
          type: array
          items:
            type: number
        deadlineMs:
          type: number
          minimum: 1
        cooldownAfterResponseMs:
          type: number
          minimum: 0
        sendWindow:
          $ref: '#/components/schemas/V1JourneySendWindowDto'
      required:
        - attemptOffsetsMs
        - deadlineMs
        - cooldownAfterResponseMs
    V1JourneyPresentationDto:
      type: object
      properties:
        imageUrl:
          type: string
        copy:
          $ref: '#/components/schemas/V1JourneyLocaleDto'
    V1JourneyLegacyToolRefDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - csat
            - ces
            - woku
            - nps
            - flow
            - form
        id:
          type: string
      required:
        - type
        - id
    V1JourneyLocaleDto:
      type: object
      properties:
        es:
          type: string
        en:
          type: string
    V1JourneySendWindowDto:
      type: object
      properties:
        startHour:
          type: number
          minimum: 0
          maximum: 23
        endHour:
          type: number
          minimum: 1
          maximum: 24
        timeZone:
          type: string
          example: America/Santiago
      required:
        - startHour
        - endHour
        - timeZone
    V1JourneyVerificationDto:
      type: object
      properties:
        mode:
          type: string
          enum:
            - woku_signature
            - url_token
            - sender_hmac
          description: >-
            Verification configuration only. Set secret material through the
            credential endpoints.
        header:
          type: string
        encoding:
          type: string
          enum:
            - hex
            - base64
        prefix:
          type: string
        signedPayload:
          type: string
          enum:
            - body
            - timestamp_dot_body
        timestampHeader:
          type: string
      required:
        - mode
    V1JourneyPayloadMapDto:
      type: object
      properties:
        subjectKey:
          type: string
          description: Dotted path to the stable case reference.
        email:
          type: string
          example: customer.email
        phone:
          type: string
          example: customer.phone
        match:
          type: array
          items:
            $ref: '#/components/schemas/V1JourneyPayloadRuleDto'
        clientFields:
          maxItems: 20
          type: array
          items:
            $ref: '#/components/schemas/V1JourneyClientFieldDto'
    V1JourneyWebhookContentDto:
      type: object
      properties:
        description:
          $ref: '#/components/schemas/V1JourneyTextValueDto'
        descriptionEn:
          $ref: '#/components/schemas/V1JourneyTextValueDto'
        folderSecondaryKey:
          $ref: '#/components/schemas/V1JourneyTextValueDto'
        folderName:
          $ref: '#/components/schemas/V1JourneyTextValueDto'
        parentFolderSecondaryKey:
          $ref: '#/components/schemas/V1JourneyTextValueDto'
        parentFolderName:
          $ref: '#/components/schemas/V1JourneyTextValueDto'
        subject:
          $ref: '#/components/schemas/V1JourneyDynamicLocaleDto'
        audience:
          $ref: '#/components/schemas/V1JourneyDynamicLocaleDto'
        imageUrlPath:
          type: string
          description: 'Woku only: dotted path to a public HTTPS image URL.'
        trackers:
          maxItems: 20
          type: array
          items:
            $ref: '#/components/schemas/V1JourneyTrackerMappingDto'
    V1JourneyPayloadRuleDto:
      type: object
      properties:
        path:
          type: string
          example: order.status
        equals:
          type: string
          example: delivered
      required:
        - path
        - equals
    V1JourneyClientFieldDto:
      type: object
      properties:
        key:
          type: string
          description: Unique Client.customFields key; at most 20 mappings.
        path:
          type: string
          example: customer.tier
      required:
        - key
        - path
    V1JourneyTextValueDto:
      type: object
      properties:
        mode:
          type: string
          enum:
            - literal
            - javascript
        value:
          type: string
          description: >-
            Literal (up to 200 characters) or bounded JavaScript function body
            (up to 2000). JavaScript receives payload and must return a string;
            no IO or imports.
      required:
        - mode
        - value
    V1JourneyDynamicLocaleDto:
      type: object
      properties:
        es:
          $ref: '#/components/schemas/V1JourneyTextValueDto'
        en:
          $ref: '#/components/schemas/V1JourneyTextValueDto'
    V1JourneyTrackerMappingDto:
      type: object
      properties:
        name:
          type: string
          description: >-
            Tracker name, at most 60 characters. Journey system trackers are
            reserved.
        path:
          type: string
          example: order.id
      required:
        - name
        - path
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: Company secret API key.

````