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

# Update an instance

> Change an instance's file, position, trim, length, or effects, or move it to another audio track with track_id. position and effects are merged into the current values.

<section className="api-next-steps" aria-label="Continue building">
  ## Continue building

  <Columns cols={2}>
    <Card title="Arrange background audio" icon="book-open" href="/guides/studio-projects">Upload files and place them on tracks.</Card>
    <Card title="Get a file" icon="file-audio" href="/api-reference/studio/get-a-file">Check that audio is ready to place.</Card>
    <Card title="Studio CLI" icon="terminal" href="/cli/reference/studio">Run the same operations from a terminal.</Card>
  </Columns>
</section>


## OpenAPI

````yaml /openapi.json patch /v1/studio/projects/{project_id}/tracks/{track_id}/instances/{instance_id}
openapi: 3.1.0
info:
  title: Breeze Developer API
  description: >-
    Breeze Developer API for models, voices, text-to-speech, history, balance,
    usage, and browser-managed API keys.
  version: 1.0.0
servers:
  - url: https://api.breeze.blue
security: []
tags:
  - name: Models
    description: Supported TTS models.
  - name: Text to Speech
    description: Text-to-speech synthesis and instruction enhancement.
  - name: Voices
    description: Saved voices and voice settings.
  - name: Voice Previews
    description: Create, audition, and save temporary voice previews.
  - name: Account
    description: Balance, usage, and API keys.
  - name: History
    description: Generated audio history.
  - name: Studio
    description: Projects, scripts, arrangement and audio materials.
paths:
  /v1/studio/projects/{project_id}/tracks/{track_id}/instances/{instance_id}:
    patch:
      tags:
        - Studio
      summary: Update an instance
      description: >-
        Change an instance's file, position, trim, length, or effects, or move
        it to another audio track with track_id. position and effects are merged
        into the current values.
      operationId: studio_instances_update
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
          description: Studio project ID, such as prj_….
        - name: track_id
          in: path
          required: true
          schema:
            type: string
            title: Track Id
          description: Audio track ID, or narration for the narration track.
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
            title: Instance Id
          description: Audio instance ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstancePatch'
      responses:
        '200':
          description: The updated project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResult'
          headers:
            x-breeze-api-key-id:
              description: >-
                Public API key identifier used to authenticate the request, when
                an API key was used.
              schema:
                type: string
        '401':
          description: HTTP 401 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: HTTP 404 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: HTTP 409 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: HTTP 422 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '504':
          description: HTTP 504 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl \
              --request PATCH \
              --url "https://api.breeze.blue/v1/studio/projects/prj_example/tracks/123e4567-e89b-42d3-a456-426614174003/instances/123e4567-e89b-42d3-a456-426614174004" \
              --header "xi-api-key: $BREEZE_API_KEY" \
              --header "Content-Type: application/json" \
              --data '{
              "expected_edit_token": "replace_with_current_edit_token",
              "operation_id": "123e4567-e89b-42d3-a456-426614174000",
              "position": {
                "mode": "follow",
                "clip_id": "clp_example",
                "edge": "start"
              }
            }'
        - lang: Python
          label: Python
          source: >-
            from breeze_blue import BreezeBlue


            client = BreezeBlue()

            result = client.studio.instances.update("prj_example",
            "123e4567-e89b-42d3-a456-426614174003",
            "123e4567-e89b-42d3-a456-426614174004", {
                "expected_edit_token": "replace_with_current_edit_token",
                "operation_id": "123e4567-e89b-42d3-a456-426614174000",
                "position": {
                    "mode": "follow",
                    "clip_id": "clp_example",
                    "edge": "start",
                },
            })
        - lang: TypeScript
          label: TypeScript
          source: >-
            import { BreezeBlueClient } from "@breeze.blue/sdk";


            const client = new BreezeBlueClient();

            const result = await client.studio.instances.update("prj_example",
            "123e4567-e89b-42d3-a456-426614174003",
            "123e4567-e89b-42d3-a456-426614174004", {
              expectedEditToken: "replace_with_current_edit_token",
              operationId: "123e4567-e89b-42d3-a456-426614174000",
              position: {
                mode: "follow",
                clipId: "clp_example",
                edge: "start",
              },
            });
components:
  schemas:
    InstancePatch:
      properties:
        expected_edit_token:
          type: string
          maxLength: 128
          minLength: 1
          title: Expected Edit Token
          description: >-
            edit_token from your latest read or write of this project. A stale
            token returns 409.
        operation_id:
          type: string
          format: uuid
          title: Operation Id
          description: >-
            New UUID for each write. Retrying with the same ID and body returns
            the original result instead of repeating the write.
        file_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: File Id
          description: Ready audio file to play.
        position:
          anyOf:
            - $ref: '#/components/schemas/Position'
            - type: 'null'
          description: Position fields to change. Omitted fields keep their values.
        trim_start:
          anyOf:
            - type: integer
              maximum: 1036800000
              minimum: 0
            - type: 'null'
          title: Trim Start
          description: First source frame to play.
        trim_end:
          anyOf:
            - type: integer
              maximum: 1036800000
              minimum: 1
            - type: 'null'
          title: Trim End
          description: Source frame where playback stops. Must be greater than trim_start.
        effects:
          anyOf:
            - $ref: '#/components/schemas/Effects'
            - type: 'null'
          description: Effect fields to change. Omitted fields keep their values.
        length:
          anyOf:
            - type: integer
              maximum: 1036800000
              minimum: 1
            - type: 'null'
          title: Length
          description: >-
            Timeline length in frames. When longer than the trimmed audio, the
            audio repeats. null plays the trimmed audio once.
        track_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Track Id
          description: Move the instance to this audio track.
      additionalProperties: false
      type: object
      required:
        - expected_edit_token
        - operation_id
      title: InstancePatch
    ProjectResult:
      properties:
        project:
          $ref: '#/components/schemas/ProjectView'
          description: The project after this request.
        edit_token:
          type: string
          title: Edit Token
          description: >-
            Current edit_token. Send it as expected_edit_token on the next
            write.
        client_refs:
          additionalProperties:
            type: string
          type: object
          title: Client Refs
          description: 'Import only: each client_ref mapped to its created ID.'
        created_ids:
          items:
            type: string
          type: array
          title: Created Ids
          description: IDs created by this request, in order.
      additionalProperties: false
      type: object
      required:
        - project
        - edit_token
      title: ProjectResult
    ErrorResponse:
      properties:
        ok:
          default: false
          title: Ok
          type: boolean
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        error:
          title: Error
          type: string
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Meta
      required:
        - code
        - detail
        - error
      title: ErrorResponse
      type: object
    ValidationErrorResponse:
      properties:
        ok:
          default: false
          title: Ok
          type: boolean
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        error:
          title: Error
          type: string
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - code
        - detail
        - error
      title: ValidationErrorResponse
      type: object
    Position:
      properties:
        mode:
          type: string
          enum:
            - fixed
            - follow
          title: Mode
          default: fixed
          description: fixed starts at frame; follow starts relative to clip_id.
        frame:
          type: integer
          maximum: 1036800000
          minimum: 0
          title: Frame
          default: 0
          description: Start frame for fixed positions.
        clip_id:
          anyOf:
            - type: string
              maxLength: 128
              minLength: 1
              pattern: \S
            - type: 'null'
          title: Clip Id
          description: Clip to follow. Required for follow positions.
        edge:
          type: string
          enum:
            - start
            - end
          title: Edge
          default: start
          description: 'Clip edge to follow: start or end.'
        offset:
          type: integer
          maximum: 1036800000
          minimum: -1036800000
          title: Offset
          default: 0
          description: Frames added to the followed edge. Negative values start earlier.
      additionalProperties: false
      type: object
      title: Position
    Effects:
      properties:
        speed:
          type: number
          maximum: 2
          minimum: 0.5
          title: Speed
          default: 1
          description: Playback speed, from 0.5 to 2.
        volume:
          type: number
          maximum: 2
          minimum: 0
          title: Volume
          default: 1
          description: Volume multiplier, from 0 to 2.
        fade_in_seconds:
          type: number
          maximum: 7200
          minimum: 0
          title: Fade In Seconds
          default: 0
          description: Fade-in duration in seconds.
        fade_out_seconds:
          type: number
          maximum: 7200
          minimum: 0
          title: Fade Out Seconds
          default: 0
          description: Fade-out duration in seconds.
      additionalProperties: false
      type: object
      title: Effects
    ProjectView:
      properties:
        id:
          type: string
          title: Id
          description: Project ID.
        title:
          type: string
          title: Title
          description: Project title.
        description:
          type: string
          title: Description
          description: Project description.
        tts_settings:
          anyOf:
            - $ref: '#/components/schemas/TtsSettingsView'
            - type: 'null'
          description: TTS model and language settings.
        default_voice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Voice Id
          description: Voice given to new clips that do not set voice_id.
        default_instructions:
          type: string
          title: Default Instructions
          description: Delivery instructions for clips with empty instructions.
        default_silence_ms:
          type: integer
          title: Default Silence Ms
          description: >-
            Silence after each clip in milliseconds, unless the clip sets
            trailing_silence_ms.
        edit_token:
          type: string
          title: Edit Token
          description: Current edit_token.
        created_at:
          type: string
          title: Created At
          description: Creation time (ISO 8601).
        updated_at:
          type: string
          title: Updated At
          description: Last update time (ISO 8601).
        chapter_count:
          type: integer
          title: Chapter Count
          description: Number of active chapters.
        clip_count:
          type: integer
          title: Clip Count
          description: Number of clips in active chapters.
      additionalProperties: false
      type: object
      required:
        - id
        - title
        - description
        - tts_settings
        - default_voice_id
        - default_instructions
        - default_silence_ms
        - edit_token
        - created_at
        - updated_at
        - chapter_count
        - clip_count
      title: ProjectView
    TtsSettingsView:
      properties:
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: TTS model ID from List models.
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
          description: Project language code.
        generation_language:
          anyOf:
            - type: string
            - type: 'null'
          title: Generation Language
          description: >-
            Language code sent with each generation. null lets the model detect
            the language.
        guidance_scale:
          anyOf:
            - type: number
            - type: 'null'
          title: Guidance Scale
          description: 'Generation guidance strength. Accepted range: 1.0 to 10.0.'
      additionalProperties: false
      type: object
      title: TtsSettingsView
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: xi-api-key
      description: Breeze Developer API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.