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

# Replace exact word timings without processing or charging credits



## OpenAPI

````yaml /openapi.json put /projects/{projectId}/alignments/{alignmentId}
openapi: 3.1.0
info:
  title: Youka REST API
  version: v1
  description: REST API for project-based karaoke creation, styling, media, and exports.
servers:
  - url: https://api.youka.io/api/v1
    description: Production
  - url: http://localhost:3003/api/v1
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Inspect the API key's account identity.
  - name: Uploads
    description: Upload source audio or video before creating a project.
  - name: Credits
    description: Inspect available credit balance.
  - name: Billing
    description: Create checkout sessions and manage billing.
  - name: Projects
    description: Create projects and read the long-lived project state.
  - name: Tasks
    description: Poll async task progress until it reaches a terminal state.
  - name: Exports
    description: Create exports and fetch fresh download URLs.
  - name: Presets
    description: Manage reusable karaoke styling presets.
  - name: Media
    description: Manage uploaded reusable media.
  - name: Project Settings
    description: Read and update a project's active settings.
paths:
  /projects/{projectId}/alignments/{alignmentId}:
    put:
      tags:
        - Projects
      summary: Replace exact word timings without processing or charging credits
      operationId: replaceProjectAlignment
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          schema:
            type: string
        - in: path
          name: projectId
          required: true
          schema:
            type: string
        - in: path
          name: alignmentId
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlignmentReplaceRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectAlignment'
        '409':
          description: >-
            Timing or selection revision changed. Fetch fresh state before
            applying edits.
components:
  schemas:
    AlignmentReplaceRequest:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        alignment:
          type: object
          properties:
            items:
              maxItems: 100000
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  line:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  word:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  subword:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  start:
                    type: number
                    minimum: 0
                  end:
                    type: number
                    minimum: 0
                  text:
                    type: string
                  singer:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  translations:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: object
                      properties:
                        text:
                          type: string
                        editedManually:
                          type: boolean
                      required:
                        - text
                      additionalProperties: false
                required:
                  - line
                  - word
                  - subword
                  - start
                  - end
                  - text
                additionalProperties: false
          required:
            - items
          additionalProperties: false
        expectedRevision:
          type: string
          minLength: 1
        select:
          type: boolean
        expectedSelectionRevision:
          type: string
          minLength: 1
      required:
        - alignment
        - expectedRevision
      additionalProperties: false
    ProjectAlignment:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        id:
          type: string
        model:
          type: string
        alignment:
          type: object
          properties:
            items:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  line:
                    type: number
                  word:
                    type: number
                  subword:
                    type: number
                  start:
                    type: number
                  end:
                    type: number
                  text:
                    type: string
                  singer:
                    type: number
                  translations:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: object
                      properties:
                        text:
                          type: string
                        editedManually:
                          type: boolean
                      required:
                        - text
                      additionalProperties: false
                required:
                  - line
                  - word
                  - subword
                  - start
                  - end
                  - text
                additionalProperties: false
          required:
            - items
          additionalProperties: false
        createdAt:
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
        revision:
          type: string
        selected:
          type: boolean
        selectionRevision:
          type: string
      required:
        - id
        - model
        - alignment
        - createdAt
        - revision
        - selected
        - selectionRevision
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````